Documentation
¶
Index ¶
- func NewControllerUpstreamMessageServiceServer(ctx context.Context, storage nodeenrollment.Storage) (pbs.UpstreamMessageServiceServer, error)
- func NewMultihopServiceServer(storage nodeenrollment.Storage, direct bool, client *atomic.Value, ...) (*multihopServiceServer, error)
- func NewWorkerServiceServer(serversRepoFn common.ServersRepoFactory, ...) *workerServiceServer
- func NewWorkerUpstreamMessageServiceServer(ctx context.Context, clientProducer UpstreamMessageServiceClientProducer) (*workerUpstreamMessageServiceServer, error)
- func RegisterUpstreamMessageHandler(ctx context.Context, msgType pbs.MsgType, h UpstreamMessageHandler) error
- func SendUpstreamMessage(ctx context.Context, clientProducer UpstreamMessageServiceClientProducer, ...) (proto.Message, error)
- func TestRegisterHandlerFn(t *testing.T, msgType pbs.MsgType, h UpstreamMessageHandler) func(*testing.T)
- type Option
- type TestMockEncryptedUpstreamMessageHandler
- func (*TestMockEncryptedUpstreamMessageHandler) AllocRequest() proto.Message
- func (*TestMockEncryptedUpstreamMessageHandler) AllocResponse() proto.Message
- func (*TestMockEncryptedUpstreamMessageHandler) Encrypted() bool
- func (h *TestMockEncryptedUpstreamMessageHandler) Handler(ctx context.Context, request proto.Message) (proto.Message, error)
- type TestMockUpstreamMessageHandler
- func (*TestMockUpstreamMessageHandler) AllocRequest() proto.Message
- func (*TestMockUpstreamMessageHandler) AllocResponse() proto.Message
- func (*TestMockUpstreamMessageHandler) Encrypted() bool
- func (h *TestMockUpstreamMessageHandler) Handler(ctx context.Context, request proto.Message) (proto.Message, error)
- type UpstreamMessageHandler
- type UpstreamMessageServiceClientProducer
- type UpstreamMessageTypeSpecifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewControllerUpstreamMessageServiceServer ¶ added in v0.13.0
func NewControllerUpstreamMessageServiceServer( ctx context.Context, storage nodeenrollment.Storage, ) (pbs.UpstreamMessageServiceServer, error)
NewControllerUpstreamMessageServiceServer creates a new service implementing UpstreamMessageServiceServer, storing values used for the implementing functions.
func NewMultihopServiceServer ¶
func NewMultihopServiceServer(storage nodeenrollment.Storage, direct bool, client *atomic.Value, opt ...nodeenrollment.Option) (*multihopServiceServer, error)
NewMultihopServiceServer creates a new service implementing MultihopServiceServer, storing values used for the implementing functions.
func NewWorkerServiceServer ¶
func NewWorkerServiceServer( serversRepoFn common.ServersRepoFactory, workerAuthRepoFn common.WorkerAuthRepoStorageFactory, sessionRepoFn session.RepositoryFactory, connectionRepoFn common.ConnectionRepoFactory, downstreams common.Downstreamers, updateTimes *sync.Map, kms *kms.Kms, livenessTimeToStale *atomic.Int64, controllerExt intglobals.ControllerExtension, ) *workerServiceServer
func NewWorkerUpstreamMessageServiceServer ¶ added in v0.13.0
func NewWorkerUpstreamMessageServiceServer( ctx context.Context, clientProducer UpstreamMessageServiceClientProducer, ) (*workerUpstreamMessageServiceServer, error)
NewWorkerUpstreamMessageServiceServer creates a new service implementing UpstreamMessageServiceServer, storing values used for the implementing functions.
func RegisterUpstreamMessageHandler ¶ added in v0.13.0
func RegisterUpstreamMessageHandler(ctx context.Context, msgType pbs.MsgType, h UpstreamMessageHandler) error
RegisterUpstreamMessageHandler will register an UpstreamMessageHandler for the specified msg name.
See controllerUpstreamMessageServiceServer.UpstreamMessage for how this is used to handle an UpstreamMessageRequest via registered upstream message handlers.
func SendUpstreamMessage ¶ added in v0.13.0
func TestRegisterHandlerFn ¶ added in v0.13.0
func TestRegisterHandlerFn(t *testing.T, msgType pbs.MsgType, h UpstreamMessageHandler) func(*testing.T)
TestRegisterHandlerFn returns a func that will register a handler for the test and then unregister it when the test is complete. This should not be used with t.Parallel() since it modifies the registered handlers for the pkg.
Types ¶
type Option ¶ added in v0.13.0
type Option func(*options)
Option - how Options are passed as arguments
func WithKeyProducer ¶ added in v0.13.0
func WithKeyProducer(nodeInfo nodeenrollment.X25519KeyProducer) Option
WithKeyProducer provides an option types.NodeInformation
type TestMockEncryptedUpstreamMessageHandler ¶ added in v0.13.0
TestMockEncryptedUpstreamMessageHandler provides a test mock handler
func (*TestMockEncryptedUpstreamMessageHandler) AllocRequest ¶ added in v0.13.0
func (*TestMockEncryptedUpstreamMessageHandler) AllocRequest() proto.Message
AllocRequest returns an allocated proto for the handler's request.
func (*TestMockEncryptedUpstreamMessageHandler) AllocResponse ¶ added in v0.13.0
func (*TestMockEncryptedUpstreamMessageHandler) AllocResponse() proto.Message
AllocResponse returns an allocated proto for the handler's response.
func (*TestMockEncryptedUpstreamMessageHandler) Encrypted ¶ added in v0.13.0
func (*TestMockEncryptedUpstreamMessageHandler) Encrypted() bool
Encrypted returns true; since the handler's request/response must be encrypted.
type TestMockUpstreamMessageHandler ¶ added in v0.13.0
TestMockUpstreamMessageHandler provides a test mock handler
func (*TestMockUpstreamMessageHandler) AllocRequest ¶ added in v0.13.0
func (*TestMockUpstreamMessageHandler) AllocRequest() proto.Message
AllocRequest returns an allocated proto for the handler's request.
func (*TestMockUpstreamMessageHandler) AllocResponse ¶ added in v0.13.0
func (*TestMockUpstreamMessageHandler) AllocResponse() proto.Message
AllocResponse returns an allocated proto for the handler's response.
func (*TestMockUpstreamMessageHandler) Encrypted ¶ added in v0.13.0
func (*TestMockUpstreamMessageHandler) Encrypted() bool
Encrypted returns false; since the handler's request/response must be encrypted.
type UpstreamMessageHandler ¶ added in v0.13.0
type UpstreamMessageHandler interface { // Handler for the request. All errors returned must be a error created // using google.golang.org/grpc/status Handler(ctx context.Context, request proto.Message) (response proto.Message, statusErr error) UpstreamMessageTypeSpecifier }
UpstreamMessageHandler defines a handler for an UpstreamMessageRequest(s).
See controllerUpstreamMessageServiceServer.UpstreamMessage for how this is used to handle an UpstreamMessageRequest via registered upstream message handlers.
type UpstreamMessageServiceClientProducer ¶ added in v0.13.0
type UpstreamMessageServiceClientProducer func(context.Context) (pbs.UpstreamMessageServiceClient, error)
UpstreamMessageServiceClientProducer produces a client and should be self-healing if an existing grpc connection closes.
func TestUpstreamService ¶ added in v0.13.0
func TestUpstreamService(t *testing.T) (UpstreamMessageServiceClientProducer, *types.NodeInformation, string)
TestUpstreamService starts a controller with a downstream worker, which are tore down at the end of the test.
Returns a UpstreamMessageServiceClientProducer for the worker, the worker's NodeInformation and the worker's KeyId.
type UpstreamMessageTypeSpecifier ¶ added in v0.13.0
type UpstreamMessageTypeSpecifier interface { // Encrypted returns true if the request/response should be encrypted Encrypted() bool // AllocRequest will allocate a type specific request proto message AllocRequest() proto.Message // AllocResponse will allocate a type specific response proto message AllocResponse() proto.Message }
UpstreamMessageTypeSpecifier defines an interface for specifying type information for an UpstreamMessageRequest(s).
See handlers.SendUpstreamMessage for how this is used to send an UpstreamMessageRequest via registered upstream message type specifiers.