srvcfg

package
v0.0.0-...-d3da680 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package srvcfg provides service-wide configs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetListenerConfig

func GetListenerConfig(ctx context.Context, meta *config.Meta) (*listenerpb.Settings, error)

GetListenerConfig loads cached Listener config.

If meta is not nil, it will be updated with the meta of the loaded config.

func ImportConfig

func ImportConfig(ctx context.Context) error

ImportConfig is called from a cron to import and cache all the configs.

func IsProjectEnabledInListener

func IsProjectEnabledInListener(ctx context.Context, project string) (bool, error)

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

func SetTestListenerConfig(ctx context.Context, ls *listenerpb.Settings, m *config.Meta) error

SetTestListenerConfig is used in tests only.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL