Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterMedianHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMedianHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MedianClient) error
- func RegisterMedianHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMedianHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MedianServer) error
- func RegisterMedianServer(s grpc.ServiceRegistrar, srv MedianServer)
- type GetMedianRequest
- func (*GetMedianRequest) Descriptor() ([]byte, []int)deprecated
- func (*GetMedianRequest) ProtoMessage()
- func (x *GetMedianRequest) ProtoReflect() protoreflect.Message
- func (x *GetMedianRequest) Reset()
- func (x *GetMedianRequest) String() string
- func (m *GetMedianRequest) Validate() error
- func (m *GetMedianRequest) ValidateAll() error
- type GetMedianRequestMultiError
- type GetMedianRequestValidationError
- func (e GetMedianRequestValidationError) Cause() error
- func (e GetMedianRequestValidationError) Error() string
- func (e GetMedianRequestValidationError) ErrorName() string
- func (e GetMedianRequestValidationError) Field() string
- func (e GetMedianRequestValidationError) Key() bool
- func (e GetMedianRequestValidationError) Reason() string
- type GetMedianResponse
- func (*GetMedianResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMedianResponse) GetStatus() *Status
- func (*GetMedianResponse) ProtoMessage()
- func (x *GetMedianResponse) ProtoReflect() protoreflect.Message
- func (x *GetMedianResponse) Reset()
- func (x *GetMedianResponse) String() string
- func (m *GetMedianResponse) Validate() error
- func (m *GetMedianResponse) ValidateAll() error
- type GetMedianResponseMultiError
- type GetMedianResponseValidationError
- func (e GetMedianResponseValidationError) Cause() error
- func (e GetMedianResponseValidationError) Error() string
- func (e GetMedianResponseValidationError) ErrorName() string
- func (e GetMedianResponseValidationError) Field() string
- func (e GetMedianResponseValidationError) Key() bool
- func (e GetMedianResponseValidationError) Reason() string
- type MedianClient
- type MedianServer
- type PushNumberRequest
- func (*PushNumberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PushNumberRequest) GetNumber() int32
- func (*PushNumberRequest) ProtoMessage()
- func (x *PushNumberRequest) ProtoReflect() protoreflect.Message
- func (x *PushNumberRequest) Reset()
- func (x *PushNumberRequest) String() string
- func (m *PushNumberRequest) Validate() error
- func (m *PushNumberRequest) ValidateAll() error
- type PushNumberRequestMultiError
- type PushNumberRequestValidationError
- func (e PushNumberRequestValidationError) Cause() error
- func (e PushNumberRequestValidationError) Error() string
- func (e PushNumberRequestValidationError) ErrorName() string
- func (e PushNumberRequestValidationError) Field() string
- func (e PushNumberRequestValidationError) Key() bool
- func (e PushNumberRequestValidationError) Reason() string
- type PushNumberResponse
- func (*PushNumberResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PushNumberResponse) GetStatus() *Status
- func (*PushNumberResponse) ProtoMessage()
- func (x *PushNumberResponse) ProtoReflect() protoreflect.Message
- func (x *PushNumberResponse) Reset()
- func (x *PushNumberResponse) String() string
- func (m *PushNumberResponse) Validate() error
- func (m *PushNumberResponse) ValidateAll() error
- type PushNumberResponseMultiError
- type PushNumberResponseValidationError
- func (e PushNumberResponseValidationError) Cause() error
- func (e PushNumberResponseValidationError) Error() string
- func (e PushNumberResponseValidationError) ErrorName() string
- func (e PushNumberResponseValidationError) Field() string
- func (e PushNumberResponseValidationError) Key() bool
- func (e PushNumberResponseValidationError) Reason() string
- type Status
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (x *Status) GetLastUpdated() *timestamppb.Timestamp
- func (x *Status) GetMedian() float64
- func (x *Status) GetSize() int32
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- func (m *Status) Validate() error
- func (m *Status) ValidateAll() error
- type StatusMultiError
- type StatusValidationError
- type UnimplementedMedianServer
- type UnsafeMedianServer
Constants ¶
const ( Median_PushNumber_FullMethodName = "/median.median/PushNumber" Median_GetMedian_FullMethodName = "/median.median/GetMedian" )
Variables ¶
var File_median_proto protoreflect.FileDescriptor
var Median_ServiceDesc = grpc.ServiceDesc{ ServiceName: "median.median", HandlerType: (*MedianServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PushNumber", Handler: _Median_PushNumber_Handler, }, { MethodName: "GetMedian", Handler: _Median_GetMedian_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "median.proto", }
Median_ServiceDesc is the grpc.ServiceDesc for Median service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMedianHandler ¶
RegisterMedianHandler registers the http handlers for service Median to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMedianHandlerClient ¶
func RegisterMedianHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MedianClient) error
RegisterMedianHandlerClient registers the http handlers for service Median to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MedianClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MedianClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MedianClient" to call the correct interceptors.
func RegisterMedianHandlerFromEndpoint ¶
func RegisterMedianHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMedianHandlerFromEndpoint is same as RegisterMedianHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMedianHandlerServer ¶
func RegisterMedianHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MedianServer) error
RegisterMedianHandlerServer registers the http handlers for service Median to "mux". UnaryRPC :call MedianServer 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 RegisterMedianHandlerFromEndpoint instead.
func RegisterMedianServer ¶
func RegisterMedianServer(s grpc.ServiceRegistrar, srv MedianServer)
Types ¶
type GetMedianRequest ¶
type GetMedianRequest struct {
// contains filtered or unexported fields
}
func (*GetMedianRequest) Descriptor
deprecated
func (*GetMedianRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMedianRequest.ProtoReflect.Descriptor instead.
func (*GetMedianRequest) ProtoMessage ¶
func (*GetMedianRequest) ProtoMessage()
func (*GetMedianRequest) ProtoReflect ¶
func (x *GetMedianRequest) ProtoReflect() protoreflect.Message
func (*GetMedianRequest) Reset ¶
func (x *GetMedianRequest) Reset()
func (*GetMedianRequest) String ¶
func (x *GetMedianRequest) String() string
func (*GetMedianRequest) Validate ¶
func (m *GetMedianRequest) Validate() error
Validate checks the field values on GetMedianRequest 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 (*GetMedianRequest) ValidateAll ¶
func (m *GetMedianRequest) ValidateAll() error
ValidateAll checks the field values on GetMedianRequest 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 GetMedianRequestMultiError, or nil if none found.
type GetMedianRequestMultiError ¶
type GetMedianRequestMultiError []error
GetMedianRequestMultiError is an error wrapping multiple validation errors returned by GetMedianRequest.ValidateAll() if the designated constraints aren't met.
func (GetMedianRequestMultiError) AllErrors ¶
func (m GetMedianRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetMedianRequestMultiError) Error ¶
func (m GetMedianRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetMedianRequestValidationError ¶
type GetMedianRequestValidationError struct {
// contains filtered or unexported fields
}
GetMedianRequestValidationError is the validation error returned by GetMedianRequest.Validate if the designated constraints aren't met.
func (GetMedianRequestValidationError) Cause ¶
func (e GetMedianRequestValidationError) Cause() error
Cause function returns cause value.
func (GetMedianRequestValidationError) Error ¶
func (e GetMedianRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetMedianRequestValidationError) ErrorName ¶
func (e GetMedianRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetMedianRequestValidationError) Field ¶
func (e GetMedianRequestValidationError) Field() string
Field function returns field value.
func (GetMedianRequestValidationError) Key ¶
func (e GetMedianRequestValidationError) Key() bool
Key function returns key value.
func (GetMedianRequestValidationError) Reason ¶
func (e GetMedianRequestValidationError) Reason() string
Reason function returns reason value.
type GetMedianResponse ¶
type GetMedianResponse struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*GetMedianResponse) Descriptor
deprecated
func (*GetMedianResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMedianResponse.ProtoReflect.Descriptor instead.
func (*GetMedianResponse) GetStatus ¶
func (x *GetMedianResponse) GetStatus() *Status
func (*GetMedianResponse) ProtoMessage ¶
func (*GetMedianResponse) ProtoMessage()
func (*GetMedianResponse) ProtoReflect ¶
func (x *GetMedianResponse) ProtoReflect() protoreflect.Message
func (*GetMedianResponse) Reset ¶
func (x *GetMedianResponse) Reset()
func (*GetMedianResponse) String ¶
func (x *GetMedianResponse) String() string
func (*GetMedianResponse) Validate ¶
func (m *GetMedianResponse) Validate() error
Validate checks the field values on GetMedianResponse 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 (*GetMedianResponse) ValidateAll ¶
func (m *GetMedianResponse) ValidateAll() error
ValidateAll checks the field values on GetMedianResponse 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 GetMedianResponseMultiError, or nil if none found.
type GetMedianResponseMultiError ¶
type GetMedianResponseMultiError []error
GetMedianResponseMultiError is an error wrapping multiple validation errors returned by GetMedianResponse.ValidateAll() if the designated constraints aren't met.
func (GetMedianResponseMultiError) AllErrors ¶
func (m GetMedianResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetMedianResponseMultiError) Error ¶
func (m GetMedianResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetMedianResponseValidationError ¶
type GetMedianResponseValidationError struct {
// contains filtered or unexported fields
}
GetMedianResponseValidationError is the validation error returned by GetMedianResponse.Validate if the designated constraints aren't met.
func (GetMedianResponseValidationError) Cause ¶
func (e GetMedianResponseValidationError) Cause() error
Cause function returns cause value.
func (GetMedianResponseValidationError) Error ¶
func (e GetMedianResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetMedianResponseValidationError) ErrorName ¶
func (e GetMedianResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetMedianResponseValidationError) Field ¶
func (e GetMedianResponseValidationError) Field() string
Field function returns field value.
func (GetMedianResponseValidationError) Key ¶
func (e GetMedianResponseValidationError) Key() bool
Key function returns key value.
func (GetMedianResponseValidationError) Reason ¶
func (e GetMedianResponseValidationError) Reason() string
Reason function returns reason value.
type MedianClient ¶
type MedianClient interface { PushNumber(ctx context.Context, in *PushNumberRequest, opts ...grpc.CallOption) (*PushNumberResponse, error) GetMedian(ctx context.Context, in *GetMedianRequest, opts ...grpc.CallOption) (*GetMedianResponse, error) }
MedianClient is the client API for Median 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 NewMedianClient ¶
func NewMedianClient(cc grpc.ClientConnInterface) MedianClient
type MedianServer ¶
type MedianServer interface { PushNumber(context.Context, *PushNumberRequest) (*PushNumberResponse, error) GetMedian(context.Context, *GetMedianRequest) (*GetMedianResponse, error) // contains filtered or unexported methods }
MedianServer is the server API for Median service. All implementations must embed UnimplementedMedianServer for forward compatibility
type PushNumberRequest ¶
type PushNumberRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*PushNumberRequest) Descriptor
deprecated
func (*PushNumberRequest) Descriptor() ([]byte, []int)
Deprecated: Use PushNumberRequest.ProtoReflect.Descriptor instead.
func (*PushNumberRequest) GetNumber ¶
func (x *PushNumberRequest) GetNumber() int32
func (*PushNumberRequest) ProtoMessage ¶
func (*PushNumberRequest) ProtoMessage()
func (*PushNumberRequest) ProtoReflect ¶
func (x *PushNumberRequest) ProtoReflect() protoreflect.Message
func (*PushNumberRequest) Reset ¶
func (x *PushNumberRequest) Reset()
func (*PushNumberRequest) String ¶
func (x *PushNumberRequest) String() string
func (*PushNumberRequest) Validate ¶
func (m *PushNumberRequest) Validate() error
Validate checks the field values on PushNumberRequest 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 (*PushNumberRequest) ValidateAll ¶
func (m *PushNumberRequest) ValidateAll() error
ValidateAll checks the field values on PushNumberRequest 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 PushNumberRequestMultiError, or nil if none found.
type PushNumberRequestMultiError ¶
type PushNumberRequestMultiError []error
PushNumberRequestMultiError is an error wrapping multiple validation errors returned by PushNumberRequest.ValidateAll() if the designated constraints aren't met.
func (PushNumberRequestMultiError) AllErrors ¶
func (m PushNumberRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PushNumberRequestMultiError) Error ¶
func (m PushNumberRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PushNumberRequestValidationError ¶
type PushNumberRequestValidationError struct {
// contains filtered or unexported fields
}
PushNumberRequestValidationError is the validation error returned by PushNumberRequest.Validate if the designated constraints aren't met.
func (PushNumberRequestValidationError) Cause ¶
func (e PushNumberRequestValidationError) Cause() error
Cause function returns cause value.
func (PushNumberRequestValidationError) Error ¶
func (e PushNumberRequestValidationError) Error() string
Error satisfies the builtin error interface
func (PushNumberRequestValidationError) ErrorName ¶
func (e PushNumberRequestValidationError) ErrorName() string
ErrorName returns error name.
func (PushNumberRequestValidationError) Field ¶
func (e PushNumberRequestValidationError) Field() string
Field function returns field value.
func (PushNumberRequestValidationError) Key ¶
func (e PushNumberRequestValidationError) Key() bool
Key function returns key value.
func (PushNumberRequestValidationError) Reason ¶
func (e PushNumberRequestValidationError) Reason() string
Reason function returns reason value.
type PushNumberResponse ¶
type PushNumberResponse struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*PushNumberResponse) Descriptor
deprecated
func (*PushNumberResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushNumberResponse.ProtoReflect.Descriptor instead.
func (*PushNumberResponse) GetStatus ¶
func (x *PushNumberResponse) GetStatus() *Status
func (*PushNumberResponse) ProtoMessage ¶
func (*PushNumberResponse) ProtoMessage()
func (*PushNumberResponse) ProtoReflect ¶
func (x *PushNumberResponse) ProtoReflect() protoreflect.Message
func (*PushNumberResponse) Reset ¶
func (x *PushNumberResponse) Reset()
func (*PushNumberResponse) String ¶
func (x *PushNumberResponse) String() string
func (*PushNumberResponse) Validate ¶
func (m *PushNumberResponse) Validate() error
Validate checks the field values on PushNumberResponse 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 (*PushNumberResponse) ValidateAll ¶
func (m *PushNumberResponse) ValidateAll() error
ValidateAll checks the field values on PushNumberResponse 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 PushNumberResponseMultiError, or nil if none found.
type PushNumberResponseMultiError ¶
type PushNumberResponseMultiError []error
PushNumberResponseMultiError is an error wrapping multiple validation errors returned by PushNumberResponse.ValidateAll() if the designated constraints aren't met.
func (PushNumberResponseMultiError) AllErrors ¶
func (m PushNumberResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PushNumberResponseMultiError) Error ¶
func (m PushNumberResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PushNumberResponseValidationError ¶
type PushNumberResponseValidationError struct {
// contains filtered or unexported fields
}
PushNumberResponseValidationError is the validation error returned by PushNumberResponse.Validate if the designated constraints aren't met.
func (PushNumberResponseValidationError) Cause ¶
func (e PushNumberResponseValidationError) Cause() error
Cause function returns cause value.
func (PushNumberResponseValidationError) Error ¶
func (e PushNumberResponseValidationError) Error() string
Error satisfies the builtin error interface
func (PushNumberResponseValidationError) ErrorName ¶
func (e PushNumberResponseValidationError) ErrorName() string
ErrorName returns error name.
func (PushNumberResponseValidationError) Field ¶
func (e PushNumberResponseValidationError) Field() string
Field function returns field value.
func (PushNumberResponseValidationError) Key ¶
func (e PushNumberResponseValidationError) Key() bool
Key function returns key value.
func (PushNumberResponseValidationError) Reason ¶
func (e PushNumberResponseValidationError) Reason() string
Reason function returns reason value.
type Status ¶
type Status struct { Median float64 `protobuf:"fixed64,1,opt,name=median,proto3" json:"median,omitempty"` Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` LastUpdated *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` // contains filtered or unexported fields }
func (*Status) Descriptor
deprecated
func (*Status) GetLastUpdated ¶
func (x *Status) GetLastUpdated() *timestamppb.Timestamp
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
func (*Status) Validate ¶
Validate checks the field values on Status 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 (*Status) ValidateAll ¶
ValidateAll checks the field values on Status 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 StatusMultiError, or nil if none found.
type StatusMultiError ¶
type StatusMultiError []error
StatusMultiError is an error wrapping multiple validation errors returned by Status.ValidateAll() if the designated constraints aren't met.
func (StatusMultiError) AllErrors ¶
func (m StatusMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (StatusMultiError) Error ¶
func (m StatusMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type StatusValidationError ¶
type StatusValidationError struct {
// contains filtered or unexported fields
}
StatusValidationError is the validation error returned by Status.Validate if the designated constraints aren't met.
func (StatusValidationError) Cause ¶
func (e StatusValidationError) Cause() error
Cause function returns cause value.
func (StatusValidationError) Error ¶
func (e StatusValidationError) Error() string
Error satisfies the builtin error interface
func (StatusValidationError) ErrorName ¶
func (e StatusValidationError) ErrorName() string
ErrorName returns error name.
func (StatusValidationError) Field ¶
func (e StatusValidationError) Field() string
Field function returns field value.
func (StatusValidationError) Key ¶
func (e StatusValidationError) Key() bool
Key function returns key value.
func (StatusValidationError) Reason ¶
func (e StatusValidationError) Reason() string
Reason function returns reason value.
type UnimplementedMedianServer ¶
type UnimplementedMedianServer struct { }
UnimplementedMedianServer must be embedded to have forward compatible implementations.
func (UnimplementedMedianServer) GetMedian ¶
func (UnimplementedMedianServer) GetMedian(context.Context, *GetMedianRequest) (*GetMedianResponse, error)
func (UnimplementedMedianServer) PushNumber ¶
func (UnimplementedMedianServer) PushNumber(context.Context, *PushNumberRequest) (*PushNumberResponse, error)
type UnsafeMedianServer ¶
type UnsafeMedianServer interface {
// contains filtered or unexported methods
}
UnsafeMedianServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MedianServer will result in compilation errors.