Documentation
¶
Index ¶
- Variables
- func GetConfigFromContext(ctx context.Context) any
- func Init(grpcContext context.Context, appConfig *config.CommonConfiguration, ...) error
- func WithGRPCConfig(parentContext context.Context, cfg any) context.Context
- type AgentGrpcError
- type ClientLoop
- type CloseFunc
- type Connection
- type ContainerCommandFunc
- type ContainerInspectFunc
- type ContainerLogEvent
- type ContainerLogFunc
- type ContainerLogReader
- type ContainerLogStream
- type ContainerStatusStream
- type DeleteContainersFunc
- type DeleteFunc
- type DeployFunc
- type DeploySharedSecretsFunc
- type GetSelfContainerNameFunc
- type ReplaceTokenFunc
- type SecretListFunc
- type SelfUpdateFunc
- type SendLogFunc
- type UpdateOptions
- type WatchContainerStatusFunc
- type WorkerFunctions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnectionRefused = errors.New("server refused connection")
Functions ¶
func GetConfigFromContext ¶
func Init ¶
func Init(grpcContext context.Context, appConfig *config.CommonConfiguration, secrets config.SecretStore, workerFuncs *WorkerFunctions, ) error
Types ¶
type AgentGrpcError ¶
func (*AgentGrpcError) Error ¶
func (e *AgentGrpcError) Error() string
type ClientLoop ¶
type ClientLoop struct { Ctx context.Context WorkerFuncs WorkerFunctions Secrets config.SecretStore AppConfig *config.CommonConfiguration NodeID string // contains filtered or unexported fields }
type CloseFunc ¶
type CloseFunc func(context.Context, agent.CloseReason, UpdateOptions) 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 ContainerCommandFunc ¶
type ContainerCommandFunc func(context.Context, *common.ContainerCommandRequest) error
type ContainerInspectFunc ¶
type ContainerLogEvent ¶
type ContainerLogFunc ¶
type ContainerLogFunc func(context.Context, *agent.ContainerLogRequest) (*ContainerLogStream, error)
type ContainerLogReader ¶
type ContainerLogReader interface { Next() <-chan ContainerLogEvent Close() error }
type ContainerLogStream ¶
type ContainerLogStream struct { Reader ContainerLogReader Echo bool }
type ContainerStatusStream ¶
type ContainerStatusStream struct { Events chan []*common.ContainerStateItem Error chan error }
type DeleteContainersFunc ¶
type DeleteContainersFunc func(context.Context, *common.DeleteContainersRequest) error
type DeployFunc ¶
type DeployFunc func(context.Context, *dogger.DeploymentLogger, *v1.DeployImageRequest, *v1.VersionData) error
type DeploySharedSecretsFunc ¶
type ReplaceTokenFunc ¶
type ReplaceTokenFunc func(context.Context, *agent.ReplaceTokenRequest) error
type SelfUpdateFunc ¶
type SelfUpdateFunc func(context.Context, *agent.AgentUpdateRequest, UpdateOptions) error
type SendLogFunc ¶
type UpdateOptions ¶
type UpdateOptions struct { // always execute the update, regardless of the actual version UpdateAlways bool // if false will not restart by itself, only a message printed about the token events UseContainers bool }
UpdateOptions options to increase update testability
type WorkerFunctions ¶
type WorkerFunctions struct { Deploy DeployFunc WatchContainerStatus WatchContainerStatusFunc Delete DeleteFunc SecretList SecretListFunc SelfUpdate SelfUpdateFunc GetSelfContainerName GetSelfContainerNameFunc Close CloseFunc ContainerCommand ContainerCommandFunc DeleteContainers DeleteContainersFunc ContainerLog ContainerLogFunc ContainerInspect ContainerInspectFunc }
Click to show internal directories.
Click to hide internal directories.