Documentation ¶
Overview ¶
Package cfgmodule provides a server module with a LUCI Config client.
It installs a LUCI Config client implementation into the context and registers config validation endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallHandlers ¶
func InstallHandlers(r *router.Router, base router.MiddlewareChain, rules *validation.RuleSet)
InstallHandlers installs the metadata and validation handlers that use the given validation rules.
It does not implement any authentication checks, thus the passed in router.MiddlewareChain should implement any necessary authentication checks.
TODO(vadimsh): Move this to serverModule.Initialize once it is the only user.
func NewModule ¶
func NewModule(opts *ModuleOptions) module.Module
NewModule returns a server module that exposes LUCI Config validation endpoints.
func NewModuleFromFlags ¶
NewModuleFromFlags is a variant of NewModule that initializes options through command line flags.
Calling this function registers flags in flag.CommandLine. They are usually parsed in server.Main(...).
Types ¶
type ModuleOptions ¶
type ModuleOptions struct { // ServiceHost is a hostname of a LUCI Config service to use. // // If given, indicates configs should be fetched from the LUCI Config service. // Not compatible with LocalDir. ServiceHost string // LocalDir is a file system directory to fetch configs from instead of // a LUCI Config service. // // See https://godoc.org/go.chromium.org/luci/config/impl/filesystem for the // expected layout of this directory. // // Useful when running locally in development mode. Not compatible with // ServiceHost. LocalDir string // Vars is a var set to use to render config set names. // // If nil, the module uses global &vars.Vars. This is usually what you want. // // During the initialization the module registers the following vars: // ${appid}: value of -cloud-project server flag. // ${config_service_appid}: app ID of the LUCI Config service. Vars *vars.VarSet // Rules is a rule set to use for the config validation. // // If nil, the module uses global &validation.Rules. This is usually what // you want. Rules *validation.RuleSet }
ModuleOptions contain configuration of the LUCI Config server module.
func (*ModuleOptions) Register ¶
func (o *ModuleOptions) Register(f *flag.FlagSet)
Register registers the command line flags.