tracker

package
v15.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatingQuerier added in v15.7.0

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

AggregatingQuerier groups polling requests.

func NewAggregatingQuerier added in v15.7.0

func NewAggregatingQuerier(log *zap.Logger, delegate Querier, api modshared.Api, pollConfig retry.PollConfigFactory, gcPeriod time.Duration) *AggregatingQuerier

func (*AggregatingQuerier) PollKasUrlsByAgentId added in v15.7.0

func (q *AggregatingQuerier) PollKasUrlsByAgentId(ctx context.Context, agentId int64, cb PollKasUrlsByAgentIdCallback)

func (*AggregatingQuerier) Run added in v15.11.0

type KasUrlsByAgentIdCallback added in v15.6.0

type KasUrlsByAgentIdCallback func(kasUrl string) (bool, error)

type PollKasUrlsByAgentIdCallback added in v15.7.0

type PollKasUrlsByAgentIdCallback func(newCycle bool, kasUrl string) bool

PollKasUrlsByAgentIdCallback is called periodically for each found kas URL for a particular agent id. newCycle is set to true on the first item of a new polling cycle i.e. after poller has slept for the polling interval.

type PollingQuerier added in v15.7.0

type PollingQuerier interface {
	PollKasUrlsByAgentId(ctx context.Context, agentId int64, cb PollKasUrlsByAgentIdCallback)
}

type Querier

type Querier interface {
	KasUrlsByAgentId(ctx context.Context, agentId int64, cb KasUrlsByAgentIdCallback) error
}

type RedisTracker

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

func NewRedisTracker

func NewRedisTracker(log *zap.Logger, api modshared.Api, client redis.UniversalClient, agentKeyPrefix string,
	ttl, refreshPeriod, gcPeriod time.Duration, ownPrivateApiUrl string) *RedisTracker

func (*RedisTracker) KasUrlsByAgentId added in v15.6.0

func (t *RedisTracker) KasUrlsByAgentId(ctx context.Context, agentId int64, cb KasUrlsByAgentIdCallback) error

func (*RedisTracker) RegisterTunnel

func (t *RedisTracker) RegisterTunnel(ctx context.Context, agentId int64) error

func (*RedisTracker) Run

func (t *RedisTracker) Run(ctx context.Context) error

func (*RedisTracker) UnregisterTunnel

func (t *RedisTracker) UnregisterTunnel(ctx context.Context, agentId int64) error

type Registerer

type Registerer interface {
	// RegisterTunnel registers tunnel with the tracker.
	RegisterTunnel(ctx context.Context, agentId int64) error
	// UnregisterTunnel unregisters tunnel with the tracker.
	UnregisterTunnel(ctx context.Context, agentId int64) error
}

type Tracker

type Tracker interface {
	Registerer
	Querier
	Run(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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