tracker

package
v14.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_module_reverse_tunnel_tracker_tracker_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type GetTunnelsByAgentIdCallback

type GetTunnelsByAgentIdCallback func(*TunnelInfo) (bool, error)

type Querier

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

type RedisTracker

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

func NewRedisTracker

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

func (*RedisTracker) GetTunnelsByAgentId

func (t *RedisTracker) GetTunnelsByAgentId(ctx context.Context, agentId int64, cb GetTunnelsByAgentIdCallback) error

func (*RedisTracker) RegisterTunnel

func (t *RedisTracker) RegisterTunnel(ctx context.Context, info *TunnelInfo) bool

func (*RedisTracker) Run

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

func (*RedisTracker) UnregisterTunnel

func (t *RedisTracker) UnregisterTunnel(ctx context.Context, info *TunnelInfo) bool

type Registerer

type Registerer interface {
	// RegisterTunnel schedules the tunnel to be registered with the tracker.
	// Returns true on success and false if ctx signaled done.
	RegisterTunnel(ctx context.Context, info *TunnelInfo) bool
	// UnregisterTunnel schedules the tunnel to be unregistered with the tracker.
	// Returns true on success and false if ctx signaled done.
	UnregisterTunnel(ctx context.Context, info *TunnelInfo) bool
}

type Tracker

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

type TunnelInfo

type TunnelInfo struct {
	AgentDescriptor *info.AgentDescriptor `protobuf:"bytes,1,opt,name=agent_descriptor,json=agentDescriptor,proto3" json:"agent_descriptor,omitempty"`
	ConnectionId    int64                 `protobuf:"varint,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
	AgentId         int64                 `protobuf:"varint,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	KasUrl          string                `protobuf:"bytes,4,opt,name=kas_url,json=kasUrl,proto3" json:"kas_url,omitempty"`
	// contains filtered or unexported fields
}

func (*TunnelInfo) Descriptor deprecated

func (*TunnelInfo) Descriptor() ([]byte, []int)

Deprecated: Use TunnelInfo.ProtoReflect.Descriptor instead.

func (*TunnelInfo) GetAgentDescriptor

func (x *TunnelInfo) GetAgentDescriptor() *info.AgentDescriptor

func (*TunnelInfo) GetAgentId

func (x *TunnelInfo) GetAgentId() int64

func (*TunnelInfo) GetConnectionId

func (x *TunnelInfo) GetConnectionId() int64

func (*TunnelInfo) GetKasUrl

func (x *TunnelInfo) GetKasUrl() string

func (*TunnelInfo) ProtoMessage

func (*TunnelInfo) ProtoMessage()

func (*TunnelInfo) ProtoReflect

func (x *TunnelInfo) ProtoReflect() protoreflect.Message

func (*TunnelInfo) Reset

func (x *TunnelInfo) Reset()

func (*TunnelInfo) String

func (x *TunnelInfo) String() string

func (*TunnelInfo) SupportsServiceAndMethod added in v14.3.0

func (x *TunnelInfo) SupportsServiceAndMethod(service, method string) bool

func (*TunnelInfo) Validate

func (m *TunnelInfo) Validate() error

Validate checks the field values on TunnelInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TunnelInfo) ValidateAll added in v14.5.0

func (m *TunnelInfo) ValidateAll() error

ValidateAll checks the field values on TunnelInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TunnelInfoMultiError, or nil if none found.

type TunnelInfoCollector

type TunnelInfoCollector []*TunnelInfo

func (*TunnelInfoCollector) Collect

func (c *TunnelInfoCollector) Collect(info *TunnelInfo) (bool, error)

type TunnelInfoMultiError added in v14.5.0

type TunnelInfoMultiError []error

TunnelInfoMultiError is an error wrapping multiple validation errors returned by TunnelInfo.ValidateAll() if the designated constraints aren't met.

func (TunnelInfoMultiError) AllErrors added in v14.5.0

func (m TunnelInfoMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TunnelInfoMultiError) Error added in v14.5.0

func (m TunnelInfoMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type TunnelInfoValidationError

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

TunnelInfoValidationError is the validation error returned by TunnelInfo.Validate if the designated constraints aren't met.

func (TunnelInfoValidationError) Cause

func (e TunnelInfoValidationError) Cause() error

Cause function returns cause value.

func (TunnelInfoValidationError) Error

Error satisfies the builtin error interface

func (TunnelInfoValidationError) ErrorName

func (e TunnelInfoValidationError) ErrorName() string

ErrorName returns error name.

func (TunnelInfoValidationError) Field

Field function returns field value.

func (TunnelInfoValidationError) Key

Key function returns key value.

func (TunnelInfoValidationError) Reason

func (e TunnelInfoValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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