transport

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectionClosed = types.NewValidationError("connection", "is closed")

Functions

This section is empty.

Types

type ConnManager added in v0.3.0

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

func NewConnManager added in v0.3.0

func NewConnManager(endpoint string) *ConnManager

func (*ConnManager) Close added in v0.3.0

func (cm *ConnManager) Close() error

func (*ConnManager) Connect added in v0.3.0

func (cm *ConnManager) Connect(ctx context.Context) error

func (*ConnManager) GetAttempts added in v0.3.3

func (cm *ConnManager) GetAttempts() int64

GetAttempts returns the number of connection attempts made

func (*ConnManager) GetConn added in v0.3.0

func (cm *ConnManager) GetConn() *grpc.ClientConn

func (*ConnManager) GetState added in v0.3.1

func (cm *ConnManager) GetState() ConnectionState

func (*ConnManager) IsRetrying added in v0.3.3

func (cm *ConnManager) IsRetrying() bool

IsRetrying returns whether a retry operation is in progress

func (*ConnManager) ResetBackoff added in v0.3.3

func (cm *ConnManager) ResetBackoff()

ResetBackoff resets the backoff to its initial state

func (*ConnManager) SetDialOptions added in v0.3.0

func (cm *ConnManager) SetDialOptions(opts []grpc.DialOption)

func (*ConnManager) StateChanges added in v0.3.1

func (cm *ConnManager) StateChanges() <-chan ConnectionState

type ConnectionState added in v0.3.0

type ConnectionState struct {
	State       connectivity.State
	LastChanged time.Time
	Endpoint    string
}

ConnectionState wraps gRPC connectivity state with additional metadata

type Metrics

type Metrics struct {
	EventsSent       int64
	BatchesSent      int64
	FailedAttempts   int64
	LastSendTime     time.Time
	LastFailureTime  time.Time
	AverageBatchSize float64
}

Metrics tracks sending statistics

type Sender

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

Sender handles event sending and metrics

func NewSender

func NewSender(apiKey, endpoint string) (*Sender, error)

func (*Sender) Close

func (s *Sender) Close() error

func (*Sender) GetMetrics

func (s *Sender) GetMetrics() Metrics

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, events []*pb.Event) error

func (*Sender) State

func (s *Sender) State() string

func (*Sender) Uptime

func (s *Sender) Uptime() time.Duration

Jump to

Keyboard shortcuts

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