Documentation ¶
Overview ¶
Package config contains all code for managing Milo's global service configuration.
Not to be confused with projectconfig, which manages configurations for projects supported by Milo (e.g. ChromeOS, Chromium).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSettings ¶
GetSettings returns the service (aka global) config for the current instance of Milo from the datastore. Returns an empty config and warn heavily if none is found. TODO(hinoka): Use process cache to cache configs.
func UpdateConfigHandler ¶
UpdateConfigHandler is an HTTP handler that handles configuration update requests.
Types ¶
type ServiceConfig ¶
type ServiceConfig struct { // ID is the datastore key. This should be static, as there should only be // one service config. ID string `gae:"$id"` // Revision is the revision of the config, taken from luci-config. This is used // to determine if the entry needs to be refreshed. Revision string // Data is the binary proto of the config. Data []byte `gae:",noindex"` // Text is the text format of the config. For human consumption only. Text string `gae:",noindex"` // LastUpdated is the time this config was last updated. LastUpdated time.Time }
ServiceConfig is a container for the instance's service config.
func GetCurrentServiceConfig ¶
func GetCurrentServiceConfig(c context.Context) (*ServiceConfig, error)
GetCurrentServiceConfig gets the service config for the instance from either process cache or datastore cache.