Documentation ¶
Index ¶
- Constants
- Variables
- type GRPCClientConn
- type PluginClient
- type PluginService
- func (s *PluginService[P, S]) Close() error
- func (s *PluginService[P, S]) HealthReport() map[string]error
- func (s *PluginService[P, S]) Init(pluginName string, p P, newService func(context.Context, any) (S, error), ...)
- func (s *PluginService[P, S]) Name() string
- func (s *PluginService[P, S]) Ready() error
- func (s *PluginService[P, S]) Start(context.Context) error
- func (s *PluginService[P, S]) WaitCtx(ctx context.Context) error
- func (s *PluginService[P, S]) XXXTestHook() TestPluginService[P, S]
- type ServiceClient
- type ServiceServer
- func (s *ServiceServer) Close(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)
- func (s *ServiceServer) HealthReport(ctx context.Context, empty *emptypb.Empty) (*pb.HealthReportReply, error)
- func (s *ServiceServer) Ready(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)
- type TestPluginService
Constants ¶
const KeepAliveTickDuration = 5 * time.Second // TODO from config
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GRPCClientConn ¶
type GRPCClientConn interface { // ClientConn returns the underlying client connection. ClientConn() grpc.ClientConnInterface }
GRPCClientConn is implemented by clients to expose their connection for efficient proxying.
type PluginClient ¶
type PluginClient struct { net.AtomicBroker net.AtomicClient *net.BrokerExt }
func NewPluginClient ¶
func NewPluginClient(broker net.Broker, brokerCfg net.BrokerConfig, conn *grpc.ClientConn) *PluginClient
func (*PluginClient) Refresh ¶
func (p *PluginClient) Refresh(broker net.Broker, conn *grpc.ClientConn)
type PluginService ¶
type PluginService[P grpcPlugin, S services.Service] struct { services.StateMachine Service S // contains filtered or unexported fields }
pluginService is a [types.Service] wrapper that maintains an internal [types.Service] created from a [grpcPlugin] client instance by launching and re-launching as necessary.
func (*PluginService[P, S]) Close ¶
func (s *PluginService[P, S]) Close() error
func (*PluginService[P, S]) HealthReport ¶
func (s *PluginService[P, S]) HealthReport() map[string]error
func (*PluginService[P, S]) Name ¶
func (s *PluginService[P, S]) Name() string
func (*PluginService[P, S]) Ready ¶
func (s *PluginService[P, S]) Ready() error
func (*PluginService[P, S]) WaitCtx ¶
func (s *PluginService[P, S]) WaitCtx(ctx context.Context) error
WaitCtx waits for the service to start up until `ctx.Done` is triggered or it receives the stop signal.
func (*PluginService[P, S]) XXXTestHook ¶
func (s *PluginService[P, S]) XXXTestHook() TestPluginService[P, S]
XXXTestHook returns a TestPluginService. It must only be called once, and before Start.
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
ServiceClient is the base client implementation of a loop as a client to the core node or to another loop that is proxied through the core node.
func NewServiceClient ¶
func NewServiceClient(b *net.BrokerExt, cc grpc.ClientConnInterface) *ServiceClient
func (*ServiceClient) ClientConn ¶
func (s *ServiceClient) ClientConn() grpc.ClientConnInterface
ClientConn implements GRPCClientConn interface.
func (*ServiceClient) Close ¶
func (s *ServiceClient) Close() error
func (*ServiceClient) HealthReport ¶
func (s *ServiceClient) HealthReport() map[string]error
func (*ServiceClient) Name ¶
func (s *ServiceClient) Name() string
func (*ServiceClient) Ready ¶
func (s *ServiceClient) Ready() error
type ServiceServer ¶
type ServiceServer struct { pb.UnimplementedServiceServer Srv services.Service }
func (*ServiceServer) HealthReport ¶
func (s *ServiceServer) HealthReport(ctx context.Context, empty *emptypb.Empty) (*pb.HealthReportReply, error)
type TestPluginService ¶
type TestPluginService[P grpcPlugin, S services.Service] chan<- func(*PluginService[P, S])
TestPluginService supports Killing & Resetting a running *pluginService.
func (TestPluginService[P, S]) Kill ¶
func (ch TestPluginService[P, S]) Kill()
func (TestPluginService[P, S]) Reset ¶
func (ch TestPluginService[P, S]) Reset()