grpc

package
v0.1.2-0...-3e0559f Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFromContext

func GetConfigFromContext(ctx context.Context) any

func Init

func Init(grpcContext context.Context,
	connParams *ConnectionParams,
	appConfig *config.CommonConfiguration,
	workerFuncs WorkerFunctions,
)

func WithGRPCConfig

func WithGRPCConfig(parentContext context.Context, cfg any) context.Context

Types

type CloseFunc

type CloseFunc func(context.Context, agent.CloseReason) error

type Connection

type Connection struct {
	Conn   *grpc.ClientConn
	Client agent.AgentClient
}

func (*Connection) SetClient

func (g *Connection) SetClient(client agent.AgentClient)

func (*Connection) SetConn

func (g *Connection) SetConn(conn *grpc.ClientConn)

type ConnectionParams

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

func TokenToConnectionParams

func TokenToConnectionParams(grpcToken *config.ValidJWT) *ConnectionParams

type ContainerCommandFunc

type ContainerCommandFunc func(context.Context, *common.ContainerCommandRequest) error

type ContainerLogContext

type ContainerLogContext struct {
	Reader     ContainerLogReader
	EnableEcho bool
}

type ContainerLogEvent

type ContainerLogEvent struct {
	Message string
	Error   error
}

type ContainerLogReader

type ContainerLogReader interface {
	Next() <-chan ContainerLogEvent
	Close() error
}

type DeleteContainersFunc

type DeleteContainersFunc func(context.Context, *common.DeleteContainersRequest) error

type DeleteFunc

type DeleteFunc func(context.Context, string, string) error

type SecretListFunc

type SecretListFunc func(context.Context, string, string) ([]string, error)

type SelfUpdateFunc

type SelfUpdateFunc func(context.Context, string, int32) error

type WatchFunc

type WatchFunc func(context.Context, string) []*common.ContainerStateItem

type WorkerFunctions

type WorkerFunctions struct {
	Deploy           DeployFunc
	Watch            WatchFunc
	Delete           DeleteFunc
	SecretList       SecretListFunc
	SelfUpdate       SelfUpdateFunc
	Close            CloseFunc
	ContainerCommand ContainerCommandFunc
	DeleteContainers DeleteContainersFunc
	ContainerLog     ContainerLogFunc
}

Jump to

Keyboard shortcuts

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