Documentation ¶
Overview ¶
Package srvcfg provides service-wide configs.
Index ¶
- func GetListenerConfig(ctx context.Context, meta *config.Meta) (*listenerpb.Settings, error)
- func ImportConfig(ctx context.Context) error
- func IsProjectEnabledInListener(ctx context.Context, project string) (bool, error)
- func MakeListenerProjectChecker(ls *listenerpb.Settings) (isEnabled func(string) bool, err error)
- func SetTestListenerConfig(ctx context.Context, ls *listenerpb.Settings, m *config.Meta) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListenerConfig ¶
GetListenerConfig loads cached Listener config.
If meta is not nil, it will be updated with the meta of the loaded config.
func ImportConfig ¶
ImportConfig is called from a cron to import and cache all the configs.
func IsProjectEnabledInListener ¶
IsProjectEnabledInListener returns true if a given project is enabled in the cached Listener config.
func MakeListenerProjectChecker ¶
func MakeListenerProjectChecker(ls *listenerpb.Settings) (isEnabled func(string) bool, err error)
MakeListenerProjectChecker returns a function that checks if a given project is enabled in the Listener config.
func SetTestListenerConfig ¶
SetTestListenerConfig is used in tests only.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.