Documentation ¶
Overview ¶
Package config abstracts access to Logdog service and project configuration.
Sync(...) assumes the context has a cfgclient implementation and a read-write datastore. All other methods need only read-only datastore.
Index ¶
- Variables
- func Config(ctx context.Context) (*svcconfig.Config, error)
- func Middleware(s *Store) router.Middleware
- func ProjectConfig(ctx context.Context, projectID string) (*svcconfig.ProjectConfig, error)
- func Sync(ctx context.Context) error
- func WithStore(ctx context.Context, s *Store) context.Context
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidConfig is returned when the configuration exists, but is invalid. ErrInvalidConfig = errors.New("invalid configuration") )
Functions ¶
func Middleware ¶
func Middleware(s *Store) router.Middleware
Middleware returns a middleware that installs `s` into requests' context.
func ProjectConfig ¶
ProjectConfig loads the project config protobuf from the config service.
This function will return following errors:
- 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.
Types ¶
Click to show internal directories.
Click to hide internal directories.