Struct omaha_client::protocol::Cohort
source · pub struct Cohort {
pub id: Option<String>,
pub hint: Option<String>,
pub name: Option<String>,
}
Expand description
The cohort identifies the update ‘track’ or ‘channel’, and is used to implement the tracking of membership in a fractional roll-out. This is per-application data.
This is sent to Omaha to identify the cohort that the application is in. This is returned (with possibly new values) by Omaha to indicate that the application is now in a different cohort. On the next update check for that application, the updater needs to use this newly returned cohort as the one that it sends to Omaha with that application.
For more information about cohorts, see the ‘cohort’, ‘cohorthint’, and ‘cohortname’ attributes of the Request.App object at:
https://github.com/google/omaha/blob/HEAD/doc/ServerProtocolV3.md#app-request
Fields§
§id: Option<String>
This is the cohort id itself.
hint: Option<String>
§name: Option<String>
Implementations§
source§impl Cohort
impl Cohort
sourcepub fn new(id: &str) -> Cohort
pub fn new(id: &str) -> Cohort
Create a new Cohort instance from just a cohort id (channel name).
pub fn from_hint(hint: &str) -> Cohort
pub fn update_from_omaha(&mut self, omaha_cohort: Self)
sourcepub fn validate_name(name: &str) -> bool
pub fn validate_name(name: &str) -> bool
A validation function to test that a given Cohort hint or name is valid per the Omaha spec: 1-1024 ascii characters, with values in the range [\u20-\u7e].