reloader

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentClient

type DeploymentClient interface {
	GetResourceVersion(ctx context.Context) (int, error)
	GetConfigWithResourceVersion(ctx context.Context) (remote.Deployment, error)
}

DeploymentClient defines GraphQL client.

type InClusterConfigReloader added in v1.5.0

type InClusterConfigReloader struct {
	// contains filtered or unexported fields
}

func NewInClusterConfigReloader added in v1.5.0

func NewInClusterConfigReloader(log logrus.FieldLogger, cli dynamic.Interface, cfg config.CfgWatcher, restarter restarter, reporter analytics.Reporter) (*InClusterConfigReloader, error)

func (*InClusterConfigReloader) Do added in v1.5.0

func (*InClusterConfigReloader) InformerFactory added in v1.5.0

type NoopReloader

type NoopReloader struct{}

NoopReloader is a reloader that does nothing.

func NewNoopReloader

func NewNoopReloader() *NoopReloader

NewNoopReloader returns new NoopReloader.

func (*NoopReloader) Do

Do does nothing.

type Reloader

type Reloader interface {
	Do(ctx context.Context) error
}

Reloader is an interface for reloading configuration.

func Get

func Get(remoteCfgEnabled bool, log logrus.FieldLogger, deployCli DeploymentClient, dynamicCli dynamic.Interface, restarter *Restarter, reporter analytics.Reporter, cfg config.Config, cfgVer int, resVerHolders ...ResourceVersionHolder) (Reloader, error)

Get returns Reloader based on remoteCfgEnabled flag.

type RemoteConfigReloader

type RemoteConfigReloader struct {
	// contains filtered or unexported fields
}

RemoteConfigReloader is responsible for reloading configuration from remote source.

func NewRemote

func NewRemote(log logrus.FieldLogger, deployCli DeploymentClient, restarter *Restarter, cfg config.Config, cfgVer int, resVerHolders ...ResourceVersionHolder) *RemoteConfigReloader

NewRemote returns new RemoteConfigReloader.

func (*RemoteConfigReloader) Do

Do starts the remote config reloader.

type ResourceVersionHolder

type ResourceVersionHolder interface {
	SetResourceVersion(int)
}

ResourceVersionHolder is an interface for holding resource version with ability to set it.

type Restarter

type Restarter struct {
	// contains filtered or unexported fields
}

Restarter is responsible for restarting the deployment.

func NewRestarter

func NewRestarter(log logrus.FieldLogger, k8sCli kubernetes.Interface, deploy config.K8sResourceRef, clusterName string, sendMsgFn SendMessageFn) *Restarter

NewRestarter returns new Restarter.

func (*Restarter) Do

func (r *Restarter) Do(ctx context.Context) error

Do restarts the deployment.

type SendMessageFn

type SendMessageFn func(msg string) error

SendMessageFn defines a function which sends a given message.

Jump to

Keyboard shortcuts

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