Documentation ¶
Overview ¶
Package health is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterHeartbeatAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHeartbeatAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HeartbeatAPIClient) error
- func RegisterHeartbeatAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHeartbeatAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HeartbeatAPIServer) error
- func RegisterHeartbeatAPIServer(s grpc.ServiceRegistrar, srv HeartbeatAPIServer)
- type CheckLiveRequest
- type CheckLiveResponse
- type CheckReadyRequest
- type CheckReadyResponse
- type Checker
- type CheckerFunc
- type HeartbeatAPI
- func (h *HeartbeatAPI) CheckLive(ctx context.Context, _ *CheckLiveRequest) (*CheckLiveResponse, error)
- func (h *HeartbeatAPI) CheckReady(ctx context.Context, _ *CheckReadyRequest) (*CheckReadyResponse, error)
- func (h *HeartbeatAPI) LogLevel() log.Level
- func (h *HeartbeatAPI) Mount(server *plex.Server)
- func (h *HeartbeatAPI) UseLiveCheck(checker Checker)
- func (h *HeartbeatAPI) UseReadyCheck(checker Checker)
- type HeartbeatAPIClient
- type HeartbeatAPIServer
- type UnimplementedHeartbeatAPIServer
- type UnsafeHeartbeatAPIServer
Constants ¶
This section is empty.
Variables ¶
var File_health_proto protoreflect.FileDescriptor
var HeartbeatAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "phogolabs.plex.health.HeartbeatAPI", HandlerType: (*HeartbeatAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CheckLive", Handler: _HeartbeatAPI_CheckLive_Handler, }, { MethodName: "CheckReady", Handler: _HeartbeatAPI_CheckReady_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "health.proto", }
HeartbeatAPI_ServiceDesc is the grpc.ServiceDesc for HeartbeatAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHeartbeatAPIHandler ¶
func RegisterHeartbeatAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHeartbeatAPIHandler registers the http handlers for service HeartbeatAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHeartbeatAPIHandlerClient ¶
func RegisterHeartbeatAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HeartbeatAPIClient) error
RegisterHeartbeatAPIHandlerClient registers the http handlers for service HeartbeatAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HeartbeatAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HeartbeatAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HeartbeatAPIClient" to call the correct interceptors.
func RegisterHeartbeatAPIHandlerFromEndpoint ¶
func RegisterHeartbeatAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHeartbeatAPIHandlerFromEndpoint is same as RegisterHeartbeatAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHeartbeatAPIHandlerServer ¶
func RegisterHeartbeatAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HeartbeatAPIServer) error
RegisterHeartbeatAPIHandlerServer registers the http handlers for service HeartbeatAPI to "mux". UnaryRPC :call HeartbeatAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHeartbeatAPIHandlerFromEndpoint instead.
func RegisterHeartbeatAPIServer ¶
func RegisterHeartbeatAPIServer(s grpc.ServiceRegistrar, srv HeartbeatAPIServer)
Types ¶
type CheckLiveRequest ¶
type CheckLiveRequest struct {
// contains filtered or unexported fields
}
CheckLiveRequest is the payload sent to check the live state
func (*CheckLiveRequest) Descriptor
deprecated
func (*CheckLiveRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckLiveRequest.ProtoReflect.Descriptor instead.
func (*CheckLiveRequest) ProtoMessage ¶
func (*CheckLiveRequest) ProtoMessage()
func (*CheckLiveRequest) ProtoReflect ¶
func (x *CheckLiveRequest) ProtoReflect() protoreflect.Message
func (*CheckLiveRequest) Reset ¶
func (x *CheckLiveRequest) Reset()
func (*CheckLiveRequest) String ¶
func (x *CheckLiveRequest) String() string
type CheckLiveResponse ¶
type CheckLiveResponse struct {
// contains filtered or unexported fields
}
CheckLiveResponse is the live state payload returned to the client
func (*CheckLiveResponse) Descriptor
deprecated
func (*CheckLiveResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckLiveResponse.ProtoReflect.Descriptor instead.
func (*CheckLiveResponse) ProtoMessage ¶
func (*CheckLiveResponse) ProtoMessage()
func (*CheckLiveResponse) ProtoReflect ¶
func (x *CheckLiveResponse) ProtoReflect() protoreflect.Message
func (*CheckLiveResponse) Reset ¶
func (x *CheckLiveResponse) Reset()
func (*CheckLiveResponse) String ¶
func (x *CheckLiveResponse) String() string
type CheckReadyRequest ¶
type CheckReadyRequest struct {
// contains filtered or unexported fields
}
CheckReadyRequest is the payload sent to check the ready state
func (*CheckReadyRequest) Descriptor
deprecated
func (*CheckReadyRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckReadyRequest.ProtoReflect.Descriptor instead.
func (*CheckReadyRequest) ProtoMessage ¶
func (*CheckReadyRequest) ProtoMessage()
func (*CheckReadyRequest) ProtoReflect ¶
func (x *CheckReadyRequest) ProtoReflect() protoreflect.Message
func (*CheckReadyRequest) Reset ¶
func (x *CheckReadyRequest) Reset()
func (*CheckReadyRequest) String ¶
func (x *CheckReadyRequest) String() string
type CheckReadyResponse ¶
type CheckReadyResponse struct {
// contains filtered or unexported fields
}
CheckReadyResponse is the ready state payload returned to the client
func (*CheckReadyResponse) Descriptor
deprecated
func (*CheckReadyResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckReadyResponse.ProtoReflect.Descriptor instead.
func (*CheckReadyResponse) ProtoMessage ¶
func (*CheckReadyResponse) ProtoMessage()
func (*CheckReadyResponse) ProtoReflect ¶
func (x *CheckReadyResponse) ProtoReflect() protoreflect.Message
func (*CheckReadyResponse) Reset ¶
func (x *CheckReadyResponse) Reset()
func (*CheckReadyResponse) String ¶
func (x *CheckReadyResponse) String() string
type CheckerFunc ¶
CheckerFunc represents a cheker function
type HeartbeatAPI ¶
HeartbeatAPI is the server API for HeartbeatAPI service.
func (*HeartbeatAPI) CheckLive ¶
func (h *HeartbeatAPI) CheckLive(ctx context.Context, _ *CheckLiveRequest) (*CheckLiveResponse, error)
CheckLive checks the live state
func (*HeartbeatAPI) CheckReady ¶
func (h *HeartbeatAPI) CheckReady(ctx context.Context, _ *CheckReadyRequest) (*CheckReadyResponse, error)
CheckReady checks the ready state
func (*HeartbeatAPI) LogLevel ¶
func (h *HeartbeatAPI) LogLevel() log.Level
LogLevel returns the desired log level
func (*HeartbeatAPI) Mount ¶
func (h *HeartbeatAPI) Mount(server *plex.Server)
Mount mounts the handler
func (*HeartbeatAPI) UseLiveCheck ¶
func (h *HeartbeatAPI) UseLiveCheck(checker Checker)
UseLiveCheck appends a live check
func (*HeartbeatAPI) UseReadyCheck ¶
func (h *HeartbeatAPI) UseReadyCheck(checker Checker)
UseReadyCheck appends a ready check
type HeartbeatAPIClient ¶
type HeartbeatAPIClient interface { // CheckLive checks the live state CheckLive(ctx context.Context, in *CheckLiveRequest, opts ...grpc.CallOption) (*CheckLiveResponse, error) // CheckReady checks the ready state CheckReady(ctx context.Context, in *CheckReadyRequest, opts ...grpc.CallOption) (*CheckReadyResponse, error) }
HeartbeatAPIClient is the client API for HeartbeatAPI 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.
func NewHeartbeatAPIClient ¶
func NewHeartbeatAPIClient(cc grpc.ClientConnInterface) HeartbeatAPIClient
type HeartbeatAPIServer ¶
type HeartbeatAPIServer interface { // CheckLive checks the live state CheckLive(context.Context, *CheckLiveRequest) (*CheckLiveResponse, error) // CheckReady checks the ready state CheckReady(context.Context, *CheckReadyRequest) (*CheckReadyResponse, error) }
HeartbeatAPIServer is the server API for HeartbeatAPI service. All implementations should embed UnimplementedHeartbeatAPIServer for forward compatibility
type UnimplementedHeartbeatAPIServer ¶
type UnimplementedHeartbeatAPIServer struct { }
UnimplementedHeartbeatAPIServer should be embedded to have forward compatible implementations.
func (UnimplementedHeartbeatAPIServer) CheckLive ¶
func (UnimplementedHeartbeatAPIServer) CheckLive(context.Context, *CheckLiveRequest) (*CheckLiveResponse, error)
func (UnimplementedHeartbeatAPIServer) CheckReady ¶
func (UnimplementedHeartbeatAPIServer) CheckReady(context.Context, *CheckReadyRequest) (*CheckReadyResponse, error)
type UnsafeHeartbeatAPIServer ¶
type UnsafeHeartbeatAPIServer interface {
// contains filtered or unexported methods
}
UnsafeHeartbeatAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HeartbeatAPIServer will result in compilation errors.