Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)
- type HealthRequest
- type HealthResponse
- func (*HealthResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HealthResponse) GetReason() string
- func (x *HealthResponse) GetStatus() Status
- func (*HealthResponse) ProtoMessage()
- func (x *HealthResponse) ProtoReflect() protoreflect.Message
- func (x *HealthResponse) Reset()
- func (x *HealthResponse) String() string
- type NotifyRequest
- func (*NotifyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NotifyRequest) GetKind() string
- func (x *NotifyRequest) GetTopics() []string
- func (x *NotifyRequest) GetUnits() []*Unit
- func (*NotifyRequest) ProtoMessage()
- func (x *NotifyRequest) ProtoReflect() protoreflect.Message
- func (x *NotifyRequest) Reset()
- func (x *NotifyRequest) String() string
- type NotifyResponse
- type PluginServiceClient
- type PluginServiceServer
- type StartRequest
- func (*StartRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StartRequest) GetHostBroker() uint32
- func (x *StartRequest) GetKind() string
- func (x *StartRequest) GetStateDir() string
- func (*StartRequest) ProtoMessage()
- func (x *StartRequest) ProtoReflect() protoreflect.Message
- func (x *StartRequest) Reset()
- func (x *StartRequest) String() string
- type StartResponse
- type Status
- type StopRequest
- type StopResponse
- type UnimplementedPluginServiceServer
- func (UnimplementedPluginServiceServer) Health(context.Context, *HealthRequest) (*HealthResponse, error)
- func (UnimplementedPluginServiceServer) Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
- func (UnimplementedPluginServiceServer) Start(context.Context, *StartRequest) (*StartResponse, error)
- func (UnimplementedPluginServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
- type Unit
- type UnsafePluginServiceServer
Constants ¶
const ( PluginService_Health_FullMethodName = "/wloop.plugin.v1.PluginService/Health" PluginService_Start_FullMethodName = "/wloop.plugin.v1.PluginService/Start" PluginService_Stop_FullMethodName = "/wloop.plugin.v1.PluginService/Stop" PluginService_Notify_FullMethodName = "/wloop.plugin.v1.PluginService/Notify" )
Variables ¶
var ( Status_name = map[int32]string{ 0: "STATUS_UNSPECIFIED", 1: "STATUS_LOADING", 2: "STATUS_SERVING", 3: "STATUS_DEGRADED", } Status_value = map[string]int32{ "STATUS_UNSPECIFIED": 0, "STATUS_LOADING": 1, "STATUS_SERVING": 2, "STATUS_DEGRADED": 3, } )
Enum value maps for Status.
var File_wloop_plugin_v1_plugin_proto protoreflect.FileDescriptor
var PluginService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "wloop.plugin.v1.PluginService", HandlerType: (*PluginServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Health", Handler: _PluginService_Health_Handler, }, { MethodName: "Start", Handler: _PluginService_Start_Handler, }, { MethodName: "Stop", Handler: _PluginService_Stop_Handler, }, { MethodName: "Notify", Handler: _PluginService_Notify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "wloop/plugin/v1/plugin.proto", }
PluginService_ServiceDesc is the grpc.ServiceDesc for PluginService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPluginServiceServer ¶
func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)
Types ¶
type HealthRequest ¶
type HealthRequest struct {
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
// contains filtered or unexported fields
}
func (*HealthRequest) Descriptor
deprecated
func (*HealthRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthRequest.ProtoReflect.Descriptor instead.
func (*HealthRequest) GetKind ¶
func (x *HealthRequest) GetKind() string
func (*HealthRequest) ProtoMessage ¶
func (*HealthRequest) ProtoMessage()
func (*HealthRequest) ProtoReflect ¶
func (x *HealthRequest) ProtoReflect() protoreflect.Message
func (*HealthRequest) Reset ¶
func (x *HealthRequest) Reset()
func (*HealthRequest) String ¶
func (x *HealthRequest) String() string
type HealthResponse ¶
type HealthResponse struct {
Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=wloop.plugin.v1.Status" json:"status,omitempty"`
// reason says why a kind is loading or degraded; empty while serving.
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*HealthResponse) Descriptor
deprecated
func (*HealthResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthResponse.ProtoReflect.Descriptor instead.
func (*HealthResponse) GetReason ¶
func (x *HealthResponse) GetReason() string
func (*HealthResponse) GetStatus ¶
func (x *HealthResponse) GetStatus() Status
func (*HealthResponse) ProtoMessage ¶
func (*HealthResponse) ProtoMessage()
func (*HealthResponse) ProtoReflect ¶
func (x *HealthResponse) ProtoReflect() protoreflect.Message
func (*HealthResponse) Reset ¶
func (x *HealthResponse) Reset()
func (*HealthResponse) String ¶
func (x *HealthResponse) String() string
type NotifyRequest ¶
type NotifyRequest struct {
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
Units []*Unit `protobuf:"bytes,2,rep,name=units,proto3" json:"units,omitempty"`
// topics name the host state that changed, such as round state.
Topics []string `protobuf:"bytes,3,rep,name=topics,proto3" json:"topics,omitempty"`
// contains filtered or unexported fields
}
func (*NotifyRequest) Descriptor
deprecated
func (*NotifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead.
func (*NotifyRequest) GetKind ¶
func (x *NotifyRequest) GetKind() string
func (*NotifyRequest) GetTopics ¶
func (x *NotifyRequest) GetTopics() []string
func (*NotifyRequest) GetUnits ¶
func (x *NotifyRequest) GetUnits() []*Unit
func (*NotifyRequest) ProtoMessage ¶
func (*NotifyRequest) ProtoMessage()
func (*NotifyRequest) ProtoReflect ¶
func (x *NotifyRequest) ProtoReflect() protoreflect.Message
func (*NotifyRequest) Reset ¶
func (x *NotifyRequest) Reset()
func (*NotifyRequest) String ¶
func (x *NotifyRequest) String() string
type NotifyResponse ¶
type NotifyResponse struct {
// contains filtered or unexported fields
}
func (*NotifyResponse) Descriptor
deprecated
func (*NotifyResponse) Descriptor() ([]byte, []int)
Deprecated: Use NotifyResponse.ProtoReflect.Descriptor instead.
func (*NotifyResponse) ProtoMessage ¶
func (*NotifyResponse) ProtoMessage()
func (*NotifyResponse) ProtoReflect ¶
func (x *NotifyResponse) ProtoReflect() protoreflect.Message
func (*NotifyResponse) Reset ¶
func (x *NotifyResponse) Reset()
func (*NotifyResponse) String ¶
func (x *NotifyResponse) String() string
type PluginServiceClient ¶
type PluginServiceClient interface {
// Health tells whether the kind is serving, and why not when it is not.
Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
// Start begins the kind's background work. The host calls it once per
// process, before any other call of the kind but Health.
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
// Stop ends the kind's background work; the host kills the process after it.
Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error)
// Notify tells the kind that host state it reads changed for these units;
// a kind that computes from that state reports those units again.
Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
}
PluginServiceClient is the client API for PluginService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
PluginService is the lifecycle every kind a plugin binary serves answers. One binary may serve several kinds over one connection, so every request names the kind it is for.
func NewPluginServiceClient ¶
func NewPluginServiceClient(cc grpc.ClientConnInterface) PluginServiceClient
type PluginServiceServer ¶
type PluginServiceServer interface {
// Health tells whether the kind is serving, and why not when it is not.
Health(context.Context, *HealthRequest) (*HealthResponse, error)
// Start begins the kind's background work. The host calls it once per
// process, before any other call of the kind but Health.
Start(context.Context, *StartRequest) (*StartResponse, error)
// Stop ends the kind's background work; the host kills the process after it.
Stop(context.Context, *StopRequest) (*StopResponse, error)
// Notify tells the kind that host state it reads changed for these units;
// a kind that computes from that state reports those units again.
Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
// contains filtered or unexported methods
}
PluginServiceServer is the server API for PluginService service. All implementations must embed UnimplementedPluginServiceServer for forward compatibility.
PluginService is the lifecycle every kind a plugin binary serves answers. One binary may serve several kinds over one connection, so every request names the kind it is for.
type StartRequest ¶
type StartRequest struct {
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
// state_dir is the plugin's own state directory, which only it reads.
StateDir string `protobuf:"bytes,2,opt,name=state_dir,json=stateDir,proto3" json:"state_dir,omitempty"`
// host_broker is the go-plugin broker id on which the host serves the
// kind's host services; zero when the host serves none for the kind.
HostBroker uint32 `protobuf:"varint,3,opt,name=host_broker,json=hostBroker,proto3" json:"host_broker,omitempty"`
// contains filtered or unexported fields
}
func (*StartRequest) Descriptor
deprecated
func (*StartRequest) Descriptor() ([]byte, []int)
Deprecated: Use StartRequest.ProtoReflect.Descriptor instead.
func (*StartRequest) GetHostBroker ¶
func (x *StartRequest) GetHostBroker() uint32
func (*StartRequest) GetKind ¶
func (x *StartRequest) GetKind() string
func (*StartRequest) GetStateDir ¶
func (x *StartRequest) GetStateDir() string
func (*StartRequest) ProtoMessage ¶
func (*StartRequest) ProtoMessage()
func (*StartRequest) ProtoReflect ¶
func (x *StartRequest) ProtoReflect() protoreflect.Message
func (*StartRequest) Reset ¶
func (x *StartRequest) Reset()
func (*StartRequest) String ¶
func (x *StartRequest) String() string
type StartResponse ¶
type StartResponse struct {
// contains filtered or unexported fields
}
func (*StartResponse) Descriptor
deprecated
func (*StartResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartResponse.ProtoReflect.Descriptor instead.
func (*StartResponse) ProtoMessage ¶
func (*StartResponse) ProtoMessage()
func (*StartResponse) ProtoReflect ¶
func (x *StartResponse) ProtoReflect() protoreflect.Message
func (*StartResponse) Reset ¶
func (x *StartResponse) Reset()
func (*StartResponse) String ¶
func (x *StartResponse) String() string
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StopRequest ¶
type StopRequest struct {
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
// contains filtered or unexported fields
}
func (*StopRequest) Descriptor
deprecated
func (*StopRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.
func (*StopRequest) GetKind ¶
func (x *StopRequest) GetKind() string
func (*StopRequest) ProtoMessage ¶
func (*StopRequest) ProtoMessage()
func (*StopRequest) ProtoReflect ¶
func (x *StopRequest) ProtoReflect() protoreflect.Message
func (*StopRequest) Reset ¶
func (x *StopRequest) Reset()
func (*StopRequest) String ¶
func (x *StopRequest) String() string
type StopResponse ¶
type StopResponse struct {
// contains filtered or unexported fields
}
func (*StopResponse) Descriptor
deprecated
func (*StopResponse) Descriptor() ([]byte, []int)
Deprecated: Use StopResponse.ProtoReflect.Descriptor instead.
func (*StopResponse) ProtoMessage ¶
func (*StopResponse) ProtoMessage()
func (*StopResponse) ProtoReflect ¶
func (x *StopResponse) ProtoReflect() protoreflect.Message
func (*StopResponse) Reset ¶
func (x *StopResponse) Reset()
func (*StopResponse) String ¶
func (x *StopResponse) String() string
type UnimplementedPluginServiceServer ¶
type UnimplementedPluginServiceServer struct{}
UnimplementedPluginServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedPluginServiceServer) Health ¶
func (UnimplementedPluginServiceServer) Health(context.Context, *HealthRequest) (*HealthResponse, error)
func (UnimplementedPluginServiceServer) Notify ¶
func (UnimplementedPluginServiceServer) Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
func (UnimplementedPluginServiceServer) Start ¶
func (UnimplementedPluginServiceServer) Start(context.Context, *StartRequest) (*StartResponse, error)
func (UnimplementedPluginServiceServer) Stop ¶
func (UnimplementedPluginServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
type Unit ¶
type Unit struct {
Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
Unit names a unit of work by its provider and the provider's key.
func (*Unit) Descriptor
deprecated
func (*Unit) GetProvider ¶
func (*Unit) ProtoMessage ¶
func (*Unit) ProtoMessage()
func (*Unit) ProtoReflect ¶
func (x *Unit) ProtoReflect() protoreflect.Message
type UnsafePluginServiceServer ¶
type UnsafePluginServiceServer interface {
// contains filtered or unexported methods
}
UnsafePluginServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginServiceServer will result in compilation errors.