Documentation ¶
Overview ¶
Package config validates and gives access to ResultDB LUCI config.
Index ¶
- Variables
- func CreatePlaceHolderServiceConfig() *configpb.Config
- func CreatePlaceholderProjectConfig() *configpb.ProjectConfig
- func GetServiceConfig(ctx context.Context) (*configpb.Config, error)
- func Project(ctx context.Context, project string) (*configpb.ProjectConfig, error)
- func Projects(ctx context.Context) (map[string]*configpb.ProjectConfig, error)
- func SetServiceConfig(ctx context.Context, cfg *configpb.Config) error
- func SetTestProjectConfig(ctx context.Context, cfg map[string]*configpb.ProjectConfig) error
- func UpdateConfig(ctx context.Context) error
- func UpdateProjects(ctx context.Context) error
- func UpdateServiceConfig(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // Returned if configuration for a given project does not exist. ErrNotFoundProjectConfig = fmt.Errorf("no project config found") )
var GCSBucketRE = regexp.MustCompile(`^[a-z0-9_\.\-]{3,222}$`)
Functions ¶
func CreatePlaceholderProjectConfig ¶
func CreatePlaceholderProjectConfig() *configpb.ProjectConfig
CreatePlaceholderProjectConfig creates a placeholder project config with default values.
func GetServiceConfig ¶
GetServiceConfig returns the cached service-level config
func Project ¶
Project returns the configurations of the requested project. Returns an ErrNotFoundProjectConfig error if config for the given project does not exist.
func Projects ¶
Projects returns all project configurations, in a map by project name. Uses in-memory cache to avoid hitting datastore all the time. Note that the config may be stale by up to 1 minute.
func SetServiceConfig ¶
SetServiceConfig installs the service into the context ctx. This is only used for the purpose of testing.
func SetTestProjectConfig ¶
SetTestProjectConfig sets test project configuration in datastore. It should be used from unit/integration tests only.
func UpdateConfig ¶
UpdateConfig is called from a cron periodically; it fetches the latest service-wide config and project config from the LUCI Config service and caches them into the datastore
func UpdateProjects ¶
UpdateProjects fetches fresh project-level configuration from LUCI Config service and stores it in datastore.
func UpdateServiceConfig ¶
UpdateServiceConfig fetches the latest service config and caches it in datastore.
Types ¶
This section is empty.