castai

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGRPCError added in v1.1.1

func IsGRPCError(err error, codes ...codes.Code) bool

Types

type Client

type Client struct {
	GRPC castaipb.RuntimeSecurityAgentAPIClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(userAgent string, cfg Config) (*Client, error)

func (*Client) Close

func (c *Client) Close()

type Config

type Config struct {
	ClusterID   string
	APIKey      string
	APIGrpcAddr string
	Insecure    bool
}

type LogsExporter

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

func NewLogsExporter

func NewLogsExporter(client *Client) *LogsExporter

func (*LogsExporter) AddLogEvent

func (l *LogsExporter) AddLogEvent(e *castaipb.LogEvent)

func (*LogsExporter) ExportFunc

func (l *LogsExporter) ExportFunc() logging.ExportFunc

func (*LogsExporter) Run

func (l *LogsExporter) Run(ctx context.Context) error

type WriteStream added in v1.1.1

type WriteStream[T, U any] struct {
	ReopenDelay time.Duration
	// contains filtered or unexported fields
}

WriteStream wraps grpc client stream and handles stream reopen in case of send errors.

func NewWriteStream added in v1.1.1

func NewWriteStream[T, U any](ctx context.Context, createStreamFunc func(ctx context.Context) (grpc.ClientStream, error)) *WriteStream[T, U]

func (*WriteStream[T, U]) Close added in v1.1.1

func (w *WriteStream[T, U]) Close() error

func (*WriteStream[T, U]) Recv added in v1.1.1

func (w *WriteStream[T, U]) Recv(m T) error

func (*WriteStream[T, U]) Send added in v1.1.1

func (w *WriteStream[T, U]) Send(m T) error

Jump to

Keyboard shortcuts

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