Documentation ¶
Overview ¶
Package public is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPublicHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPublicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicClient) error
- func RegisterPublicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPublicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicServer) error
- func RegisterPublicServer(s grpc.ServiceRegistrar, srv PublicServer)
- type GetInstanceResponse
- func (*GetInstanceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetInstanceResponse) GetCode() string
- func (x *GetInstanceResponse) GetVersion() string
- func (*GetInstanceResponse) ProtoMessage()
- func (x *GetInstanceResponse) ProtoReflect() protoreflect.Message
- func (x *GetInstanceResponse) Reset()
- func (x *GetInstanceResponse) String() string
- func (m *GetInstanceResponse) Validate() error
- func (m *GetInstanceResponse) ValidateAll() error
- type GetInstanceResponseMultiError
- type GetInstanceResponseValidationError
- func (e GetInstanceResponseValidationError) Cause() error
- func (e GetInstanceResponseValidationError) Error() string
- func (e GetInstanceResponseValidationError) ErrorName() string
- func (e GetInstanceResponseValidationError) Field() string
- func (e GetInstanceResponseValidationError) Key() bool
- func (e GetInstanceResponseValidationError) Reason() string
- type PublicClient
- type PublicServer
- type UnimplementedPublicServer
- type UnsafePublicServer
Constants ¶
const (
Public_GetInstance_FullMethodName = "/apis.proto.v1alpha1.public.Public/GetInstance"
)
Variables ¶
var File_proto_v1alpha1_public_public_proto protoreflect.FileDescriptor
var Public_ServiceDesc = grpc.ServiceDesc{ ServiceName: "apis.proto.v1alpha1.public.Public", HandlerType: (*PublicServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInstance", Handler: _Public_GetInstance_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/v1alpha1/public/public.proto", }
Public_ServiceDesc is the grpc.ServiceDesc for Public service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPublicHandler ¶
RegisterPublicHandler registers the http handlers for service Public to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPublicHandlerClient ¶
func RegisterPublicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicClient) error
RegisterPublicHandlerClient registers the http handlers for service Public to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PublicClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PublicClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PublicClient" to call the correct interceptors.
func RegisterPublicHandlerFromEndpoint ¶
func RegisterPublicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPublicHandlerFromEndpoint is same as RegisterPublicHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPublicHandlerServer ¶
func RegisterPublicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicServer) error
RegisterPublicHandlerServer registers the http handlers for service Public to "mux". UnaryRPC :call PublicServer 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 RegisterPublicHandlerFromEndpoint instead.
func RegisterPublicServer ¶
func RegisterPublicServer(s grpc.ServiceRegistrar, srv PublicServer)
Types ¶
type GetInstanceResponse ¶
type GetInstanceResponse struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func (*GetInstanceResponse) Descriptor
deprecated
func (*GetInstanceResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetInstanceResponse.ProtoReflect.Descriptor instead.
func (*GetInstanceResponse) GetCode ¶
func (x *GetInstanceResponse) GetCode() string
func (*GetInstanceResponse) GetVersion ¶
func (x *GetInstanceResponse) GetVersion() string
func (*GetInstanceResponse) ProtoMessage ¶
func (*GetInstanceResponse) ProtoMessage()
func (*GetInstanceResponse) ProtoReflect ¶
func (x *GetInstanceResponse) ProtoReflect() protoreflect.Message
func (*GetInstanceResponse) Reset ¶
func (x *GetInstanceResponse) Reset()
func (*GetInstanceResponse) String ¶
func (x *GetInstanceResponse) String() string
func (*GetInstanceResponse) Validate ¶
func (m *GetInstanceResponse) Validate() error
Validate checks the field values on GetInstanceResponse 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 (*GetInstanceResponse) ValidateAll ¶
func (m *GetInstanceResponse) ValidateAll() error
ValidateAll checks the field values on GetInstanceResponse 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 GetInstanceResponseMultiError, or nil if none found.
type GetInstanceResponseMultiError ¶
type GetInstanceResponseMultiError []error
GetInstanceResponseMultiError is an error wrapping multiple validation errors returned by GetInstanceResponse.ValidateAll() if the designated constraints aren't met.
func (GetInstanceResponseMultiError) AllErrors ¶
func (m GetInstanceResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetInstanceResponseMultiError) Error ¶
func (m GetInstanceResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetInstanceResponseValidationError ¶
type GetInstanceResponseValidationError struct {
// contains filtered or unexported fields
}
GetInstanceResponseValidationError is the validation error returned by GetInstanceResponse.Validate if the designated constraints aren't met.
func (GetInstanceResponseValidationError) Cause ¶
func (e GetInstanceResponseValidationError) Cause() error
Cause function returns cause value.
func (GetInstanceResponseValidationError) Error ¶
func (e GetInstanceResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetInstanceResponseValidationError) ErrorName ¶
func (e GetInstanceResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetInstanceResponseValidationError) Field ¶
func (e GetInstanceResponseValidationError) Field() string
Field function returns field value.
func (GetInstanceResponseValidationError) Key ¶
func (e GetInstanceResponseValidationError) Key() bool
Key function returns key value.
func (GetInstanceResponseValidationError) Reason ¶
func (e GetInstanceResponseValidationError) Reason() string
Reason function returns reason value.
type PublicClient ¶
type PublicClient interface {
GetInstance(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetInstanceResponse, error)
}
PublicClient is the client API for Public 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 NewPublicClient ¶
func NewPublicClient(cc grpc.ClientConnInterface) PublicClient
type PublicServer ¶
type PublicServer interface {
GetInstance(context.Context, *emptypb.Empty) (*GetInstanceResponse, error)
}
PublicServer is the server API for Public service. All implementations should embed UnimplementedPublicServer for forward compatibility
type UnimplementedPublicServer ¶
type UnimplementedPublicServer struct { }
UnimplementedPublicServer should be embedded to have forward compatible implementations.
func (UnimplementedPublicServer) GetInstance ¶
func (UnimplementedPublicServer) GetInstance(context.Context, *emptypb.Empty) (*GetInstanceResponse, error)
type UnsafePublicServer ¶
type UnsafePublicServer interface {
// contains filtered or unexported methods
}
UnsafePublicServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PublicServer will result in compilation errors.