luci: go.chromium.org/luci/config/server/cfgmodule Index | Files

package cfgmodule

import "go.chromium.org/luci/config/server/cfgmodule"

Package cfgmodule provides a server module that registers config validation hooks.

Index

Package Files

doc.go handler.go module.go

func InstallHandlers Uses

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 Uses

func NewModule(opts *ModuleOptions) module.Module

NewModule returns a server module that exposes LUCI Config validation endpoints.

TODO(vadimsh): Make it also be responsible for fetching configs, somehow.

func NewModuleFromFlags Uses

func NewModuleFromFlags() module.Module

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(...).

type ModuleOptions Uses

type ModuleOptions struct {
    ConfigServiceHost string // a hostname of a LUCI Config service to use

    // 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.
    //
    // During the initialization the module registers the following vars in the
    // rule set:
    //   ${appid}: value of -cloud-project server flag.
    //   ${config_service_appid}: app ID of the LUCI Config service.
    Rules *validation.RuleSet
}

ModuleOptions contain configuration of the LUCI Config server module.

func (*ModuleOptions) Register Uses

func (o *ModuleOptions) Register(f *flag.FlagSet)

Register registers the command line flags.

Package cfgmodule imports 16 packages (graph) and is imported by 2 packages. Updated 2020-04-09. Refresh now. Tools for package owners.