Documentation ¶
Index ¶
- Variables
- func ActiveProjects(c context.Context) ([]cfgtypes.ProjectName, error)
- func ActiveUserProjects(c context.Context) ([]cfgtypes.ProjectName, error)
- func ProjectConfig(c context.Context, project cfgtypes.ProjectName) (*svcconfig.ProjectConfig, error)
- func ProjectConfigPath(c context.Context) string
- func ProjectNames(c context.Context, a cfgclient.Authority) ([]cfgtypes.ProjectName, error)
- func ServiceConfigPath(c context.Context) (cfgtypes.ConfigSet, string)
- type Config
- type Settings
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ActiveProjects ¶
func ActiveProjects(c context.Context) ([]cfgtypes.ProjectName, error)
ActiveProjects returns a full list of all config service projects with LogDog project configurations.
The list will be alphabetically sorted.
func ActiveUserProjects ¶
func ActiveUserProjects(c context.Context) ([]cfgtypes.ProjectName, error)
ActiveUserProjects returns a full list of all config service projects with LogDog project configurations that the current user can see.
The list will be alphabetically sorted.
func ProjectConfig ¶
func ProjectConfig(c context.Context, project cfgtypes.ProjectName) (*svcconfig.ProjectConfig, error)
ProjectConfig loads the project config protobuf from the config service.
This function will return:
- nil, if the project exists and the configuration successfully loaded
- config.ErrNoConfig if the project configuration was not present.
- ErrInvalidConfig if the project configuration was present, but could not be loaded.
- Some other error if an error occurred that does not fit one of the previous categories.
func ProjectConfigPath ¶
ProjectConfigPath returns the path of the project-specific configuration. This path should be used with a project config set.
A given project's configuration is named after the current App ID.
func ProjectNames ¶
ProjectNames returns a sorted list of the names of all of the projects that the supplied authority can view.
Types ¶
type Config ¶
type Config struct { svcconfig.Config // Settings are per-instance settings. Settings Settings // ConfigServiceURL is the config service's URL. ConfigServiceURL url.URL `json:"-"` // ConfigSet is the name of the service config set that is being used. ConfigSet cfgtypes.ConfigSet `json:"-"` // ServiceConfigPath is the path within ConfigSet of the service // configuration. ServiceConfigPath string `json:"-"` }
Config is the LogDog Coordinator service configuration.
func Load ¶
Load loads the service configuration. This includes:
- The config service settings.
- The service configuration, loaded from the config service.
- Additional Settings data from datastore via settings.
The service config is minimally validated prior to being returned.
type Settings ¶
type Settings struct { // BigTableServiceAccountJSON, if not empty, is the service account JSON file // data that will be used for BigTable access. // // TODO(dnj): Remove this option once Cloud BigTable has cross-project ACLs. BigTableServiceAccountJSON []byte `json:"bigTableServiceAccountJson"` }
Settings is the LogDog Coordinator auxiliary (runtime) settings. These are stored within a given datastore instance, rather than in luci-config, due to their sensitivity.
func (*Settings) Load ¶
Load populates the settings instance from the stored settings.
If no settings are stored, an empty Settings instance will be loaded and this will return nil.
An error will be returned if an operation that is expected to succeed fails.
func (*Settings) Store ¶
Store stores the new global configuration.