connection

package
v0.0.0-...-a16fe4d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Connection

The Connection is now working by gRPC for communicating with server.

Connection will temporary stay in directory agent instead of SDC since agent should be this only process to communicate with the server. In Osquery(kolide), only hostname is specific in compile time. The reference is here: https://github.com/kolide/launcher/blob/main/pkg/service/client_grpc.go#L102

For high performance requirements(low latency, high traffic), a look-aside load balancing is required just like Elkeid agent does. The client-side LB using grpc-LB protocol. There are 3 of the protocols.

1. pick_first (Elkeid way) 2. round_robin 3. grpclb(dropped, xDS instead)

The xDS(x Discovery Service) with it's recommanded docs here: https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol APIs: - Listener Discovery Service(LDS) - Route Discovery Service (RDS) - Cluster Discovery Service (CDS) - Endpoint Discovery Service (EDS) - Aggregate Discovery Service (ADS) (coming soon)

References: https://grpc.io/blog/grpc-load-balancing/ https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

From Elkeid StatsHandler

Index

Constants

This section is empty.

Variables

View Source
var CaCert []byte
View Source
var ClientCert []byte
View Source
var ClientKey []byte
View Source
var (
	DefaultStatsHandler = StatsHandler{
		// contains filtered or unexported fields
	}
)
View Source
var GrpcAddr string
View Source
var InsecureTLS bool
View Source
var InsecureTransport bool

Functions

func GetConnection

func GetConnection(ctx context.Context) (c *grpc.ClientConn, err error)

Types

type Connection

type Connection struct {
	Addr    string
	Options []grpc.DialOption
	Conn    atomic.Value
	NetMode atomic.Value
}

func New

func New() *Connection

func (*Connection) Connect

func (c *Connection) Connect(ctx context.Context) error

func (*Connection) String

func (c *Connection) String() string

type Stats

type Stats struct {
	RxSpeed float64
	TxSpeed float64
}

type StatsHandler

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

func (*StatsHandler) GetStats

func (h *StatsHandler) GetStats(now time.Time) (s Stats)

func (*StatsHandler) HandleConn

func (h *StatsHandler) HandleConn(ctx context.Context, _ stats.ConnStats)

func (*StatsHandler) HandleRPC

func (h *StatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)

func (*StatsHandler) TagConn

func (*StatsHandler) TagRPC

func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context

Jump to

Keyboard shortcuts

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