Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigNotModified = errors.New("config not modified")
Functions ¶
This section is empty.
Types ¶
type ConfigPoller ¶
type ConfigPoller interface { // Subscribe subscribes to the config poller with a handler function that will be invoked // with the latest router config and the previous version string. If the handler takes longer than the poll interval // to execute, the next invocation will be skipped. Subscribe(ctx context.Context, handler func(newConfig *nodev1.RouterConfig, oldVersion string) error) // GetRouterConfig returns the latest router config from the CDN // If the Config is nil, no new config is available and the current config should be used. // and updates the latest router config version. This method is only used for the initial config GetRouterConfig(ctx context.Context) (*routerconfig.Response, error) // Stop stops the config poller. After calling stop, the config poller cannot be used again. Stop(ctx context.Context) error }
func New ¶
func New(token string, opts ...Option) ConfigPoller
type Option ¶
type Option func(cp *configPoller)
func WithClient ¶
func WithClient(client routerconfig.Client) Option
func WithFallbackClient ¶
func WithFallbackClient(client *routerconfig.Client) Option
func WithLogger ¶
func WithPollInterval ¶
Click to show internal directories.
Click to hide internal directories.