Documentation
¶
Overview ¶
Package cluster is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterClusterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterClusterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterClient) error
- func RegisterClusterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterServer) error
- func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer)
- type ClusterClient
- type ClusterServer
- type InfoRequest
- func (*InfoRequest) Descriptor() ([]byte, []int)deprecated
- func (*InfoRequest) ProtoMessage()
- func (x *InfoRequest) ProtoReflect() protoreflect.Message
- func (x *InfoRequest) Reset()
- func (x *InfoRequest) String() string
- func (m *InfoRequest) Validate() error
- func (m *InfoRequest) ValidateAll() error
- type InfoRequestMultiError
- type InfoRequestValidationError
- func (e InfoRequestValidationError) Cause() error
- func (e InfoRequestValidationError) Error() string
- func (e InfoRequestValidationError) ErrorName() string
- func (e InfoRequestValidationError) Field() string
- func (e InfoRequestValidationError) Key() bool
- func (e InfoRequestValidationError) Reason() string
- type InfoResponse
- func (*InfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InfoResponse) GetItem() *websocket.ClusterInfo
- func (*InfoResponse) ProtoMessage()
- func (x *InfoResponse) ProtoReflect() protoreflect.Message
- func (x *InfoResponse) Reset()
- func (x *InfoResponse) String() string
- func (m *InfoResponse) Validate() error
- func (m *InfoResponse) ValidateAll() error
- type InfoResponseMultiError
- type InfoResponseValidationError
- func (e InfoResponseValidationError) Cause() error
- func (e InfoResponseValidationError) Error() string
- func (e InfoResponseValidationError) ErrorName() string
- func (e InfoResponseValidationError) Field() string
- func (e InfoResponseValidationError) Key() bool
- func (e InfoResponseValidationError) Reason() string
- type Status
- type UnimplementedClusterServer
- type UnsafeClusterServer
Constants ¶
const (
Cluster_ClusterInfo_FullMethodName = "/cluster.Cluster/ClusterInfo"
)
Variables ¶
var ( Status_name = map[int32]string{ 0: "StatusUnknown", 1: "StatusBad", 2: "StatusNotGood", 3: "StatusHealth", } Status_value = map[string]int32{ "StatusUnknown": 0, "StatusBad": 1, "StatusNotGood": 2, "StatusHealth": 3, } )
Enum value maps for Status.
var Cluster_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cluster.Cluster", HandlerType: (*ClusterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ClusterInfo", Handler: _Cluster_ClusterInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cluster/cluster.proto", }
Cluster_ServiceDesc is the grpc.ServiceDesc for Cluster service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cluster_cluster_proto protoreflect.FileDescriptor
Functions ¶
func RegisterClusterHandler ¶
func RegisterClusterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterClusterHandler registers the http handlers for service Cluster to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterClusterHandlerClient ¶
func RegisterClusterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterClient) error
RegisterClusterHandlerClient registers the http handlers for service Cluster to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ClusterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ClusterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ClusterClient" to call the correct interceptors.
func RegisterClusterHandlerFromEndpoint ¶
func RegisterClusterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterClusterHandlerFromEndpoint is same as RegisterClusterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterClusterHandlerServer ¶
func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterServer) error
RegisterClusterHandlerServer registers the http handlers for service Cluster to "mux". UnaryRPC :call ClusterServer 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 RegisterClusterHandlerFromEndpoint instead.
func RegisterClusterServer ¶
func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer)
Types ¶
type ClusterClient ¶
type ClusterClient interface {
ClusterInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
}
ClusterClient is the client API for Cluster 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 NewClusterClient ¶
func NewClusterClient(cc grpc.ClientConnInterface) ClusterClient
type ClusterServer ¶
type ClusterServer interface { ClusterInfo(context.Context, *InfoRequest) (*InfoResponse, error) // contains filtered or unexported methods }
ClusterServer is the server API for Cluster service. All implementations must embed UnimplementedClusterServer for forward compatibility
type InfoRequest ¶
type InfoRequest struct {
// contains filtered or unexported fields
}
func (*InfoRequest) Descriptor
deprecated
func (*InfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.
func (*InfoRequest) ProtoMessage ¶
func (*InfoRequest) ProtoMessage()
func (*InfoRequest) ProtoReflect ¶
func (x *InfoRequest) ProtoReflect() protoreflect.Message
func (*InfoRequest) Reset ¶
func (x *InfoRequest) Reset()
func (*InfoRequest) String ¶
func (x *InfoRequest) String() string
func (*InfoRequest) Validate ¶
func (m *InfoRequest) Validate() error
Validate checks the field values on InfoRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InfoRequest) ValidateAll ¶
func (m *InfoRequest) ValidateAll() error
ValidateAll checks the field values on InfoRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InfoRequestMultiError, or nil if none found.
type InfoRequestMultiError ¶
type InfoRequestMultiError []error
InfoRequestMultiError is an error wrapping multiple validation errors returned by InfoRequest.ValidateAll() if the designated constraints aren't met.
func (InfoRequestMultiError) AllErrors ¶
func (m InfoRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InfoRequestMultiError) Error ¶
func (m InfoRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InfoRequestValidationError ¶
type InfoRequestValidationError struct {
// contains filtered or unexported fields
}
InfoRequestValidationError is the validation error returned by InfoRequest.Validate if the designated constraints aren't met.
func (InfoRequestValidationError) Cause ¶
func (e InfoRequestValidationError) Cause() error
Cause function returns cause value.
func (InfoRequestValidationError) Error ¶
func (e InfoRequestValidationError) Error() string
Error satisfies the builtin error interface
func (InfoRequestValidationError) ErrorName ¶
func (e InfoRequestValidationError) ErrorName() string
ErrorName returns error name.
func (InfoRequestValidationError) Field ¶
func (e InfoRequestValidationError) Field() string
Field function returns field value.
func (InfoRequestValidationError) Key ¶
func (e InfoRequestValidationError) Key() bool
Key function returns key value.
func (InfoRequestValidationError) Reason ¶
func (e InfoRequestValidationError) Reason() string
Reason function returns reason value.
type InfoResponse ¶
type InfoResponse struct { Item *websocket.ClusterInfo `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
func (*InfoResponse) Descriptor
deprecated
func (*InfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.
func (*InfoResponse) GetItem ¶
func (x *InfoResponse) GetItem() *websocket.ClusterInfo
func (*InfoResponse) ProtoMessage ¶
func (*InfoResponse) ProtoMessage()
func (*InfoResponse) ProtoReflect ¶
func (x *InfoResponse) ProtoReflect() protoreflect.Message
func (*InfoResponse) Reset ¶
func (x *InfoResponse) Reset()
func (*InfoResponse) String ¶
func (x *InfoResponse) String() string
func (*InfoResponse) Validate ¶
func (m *InfoResponse) Validate() error
Validate checks the field values on InfoResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InfoResponse) ValidateAll ¶
func (m *InfoResponse) ValidateAll() error
ValidateAll checks the field values on InfoResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InfoResponseMultiError, or nil if none found.
type InfoResponseMultiError ¶
type InfoResponseMultiError []error
InfoResponseMultiError is an error wrapping multiple validation errors returned by InfoResponse.ValidateAll() if the designated constraints aren't met.
func (InfoResponseMultiError) AllErrors ¶
func (m InfoResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InfoResponseMultiError) Error ¶
func (m InfoResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InfoResponseValidationError ¶
type InfoResponseValidationError struct {
// contains filtered or unexported fields
}
InfoResponseValidationError is the validation error returned by InfoResponse.Validate if the designated constraints aren't met.
func (InfoResponseValidationError) Cause ¶
func (e InfoResponseValidationError) Cause() error
Cause function returns cause value.
func (InfoResponseValidationError) Error ¶
func (e InfoResponseValidationError) Error() string
Error satisfies the builtin error interface
func (InfoResponseValidationError) ErrorName ¶
func (e InfoResponseValidationError) ErrorName() string
ErrorName returns error name.
func (InfoResponseValidationError) Field ¶
func (e InfoResponseValidationError) Field() string
Field function returns field value.
func (InfoResponseValidationError) Key ¶
func (e InfoResponseValidationError) Key() bool
Key function returns key value.
func (InfoResponseValidationError) Reason ¶
func (e InfoResponseValidationError) Reason() string
Reason function returns reason value.
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 UnimplementedClusterServer ¶
type UnimplementedClusterServer struct { }
UnimplementedClusterServer must be embedded to have forward compatible implementations.
func (UnimplementedClusterServer) ClusterInfo ¶
func (UnimplementedClusterServer) ClusterInfo(context.Context, *InfoRequest) (*InfoResponse, error)
type UnsafeClusterServer ¶
type UnsafeClusterServer interface {
// contains filtered or unexported methods
}
UnsafeClusterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ClusterServer will result in compilation errors.