register

package
v0.0.0-...-ba42cd1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionMonitoringInterval = 10 * time.Second
	ConnectionMonitoringJitter   = 5 * time.Second
)
View Source
const (
	RetryRegisterTime   = time.Second * 1
	RetryRegisterJitter = time.Second * 3

	RetryRemoveTime   = time.Second * 1
	RetryRemoveJitter = time.Second * 1

	CheckInterval = time.Second * 7
	CheckJitter   = time.Second * 3
)

Variables

This section is empty.

Functions

func ChangelogToString

func ChangelogToString(changes diff.Changelog) string

func Jitter

func Jitter(base time.Duration, jitter time.Duration) time.Duration

Types

type Config

type Config struct {
	Ctx context.Context

	Sources SourceConfig
	Client  *api.Client

	DeletePreparedQueriesOnExit bool
}

type ConfigAccumulator

type ConfigAccumulator struct {
	Queries        []*api.PreparedQueryDefinition
	ConsulLoadOpts config.LoadOpts
}

type QueryRegistration

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

func NewPreparedQueryRegistration

func NewPreparedQueryRegistration(
	ctx context.Context,
	wg *sync.WaitGroup,
	client *api.Client,
	deleteOnExit bool,
	def *api.PreparedQueryDefinition,
) *QueryRegistration

func (*QueryRegistration) Destroy

func (s *QueryRegistration) Destroy()

func (*QueryRegistration) Update

type RegistrationService

type RegistrationService interface {
	Health() error
	Reload(ctx context.Context) error
	Wait(timeout time.Duration) error
}

func New

func New(config *Config) (RegistrationService, error)

type RuntimeConfig

type RuntimeConfig struct {
	Queries  []*api.PreparedQueryDefinition
	Services []*api.AgentServiceRegistration
}

func LoadSources

func LoadSources(sources *SourceConfig) (*RuntimeConfig, error)

type ServiceRegistration

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

func NewServiceRegistration

func NewServiceRegistration(
	ctx context.Context,
	wg *sync.WaitGroup,
	client *api.Client,
	def *api.AgentServiceRegistration,
) *ServiceRegistration

func (*ServiceRegistration) Destroy

func (s *ServiceRegistration) Destroy()

func (*ServiceRegistration) Update

type SourceConfig

type SourceConfig struct {
	ConfigDirectories []string
	ConfigFiles       []string
}

Jump to

Keyboard shortcuts

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