Documentation ¶
Overview ¶
Package shortsv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterShortsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterShortsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShortsServiceClient) error
- func RegisterShortsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterShortsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShortsServiceServer) error
- func RegisterShortsServiceServer(s grpc.ServiceRegistrar, srv ShortsServiceServer)
- type GetLatestShortsRequest
- type GetShortsResponse
- type ShortsDetails
- func (*ShortsDetails) Descriptor() ([]byte, []int)deprecated
- func (x *ShortsDetails) GetApiVersion() string
- func (x *ShortsDetails) GetStatus() Status
- func (*ShortsDetails) ProtoMessage()
- func (x *ShortsDetails) ProtoReflect() protoreflect.Message
- func (x *ShortsDetails) Reset()
- func (x *ShortsDetails) String() string
- type ShortsServiceClient
- type ShortsServiceServer
- type Status
- type UnimplementedShortsServiceServer
- type UnsafeShortsServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "UNSPECIFIED", 1: "PENDING", 2: "SUCCESS", 3: "FAILURE", } Status_value = map[string]int32{ "UNSPECIFIED": 0, "PENDING": 1, "SUCCESS": 2, "FAILURE": 3, } )
Enum value maps for Status.
var File_shortsapi_v1_service_proto protoreflect.FileDescriptor
var File_shortsapi_v1_shorts_proto protoreflect.FileDescriptor
var ShortsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "shorted.service.shorts.v1.ShortsService", HandlerType: (*ShortsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetShortsLatest", Handler: _ShortsService_GetShortsLatest_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "shortsapi/v1/service.proto", }
ShortsService_ServiceDesc is the grpc.ServiceDesc for ShortsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterShortsServiceHandler ¶
func RegisterShortsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterShortsServiceHandler registers the http handlers for service ShortsService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterShortsServiceHandlerClient ¶
func RegisterShortsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShortsServiceClient) error
RegisterShortsServiceHandlerClient registers the http handlers for service ShortsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ShortsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ShortsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ShortsServiceClient" to call the correct interceptors.
func RegisterShortsServiceHandlerFromEndpoint ¶
func RegisterShortsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterShortsServiceHandlerFromEndpoint is same as RegisterShortsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterShortsServiceHandlerServer ¶
func RegisterShortsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShortsServiceServer) error
RegisterShortsServiceHandlerServer registers the http handlers for service ShortsService to "mux". UnaryRPC :call ShortsServiceServer 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 RegisterShortsServiceHandlerFromEndpoint instead.
func RegisterShortsServiceServer ¶
func RegisterShortsServiceServer(s grpc.ServiceRegistrar, srv ShortsServiceServer)
Types ¶
type GetLatestShortsRequest ¶
type GetLatestShortsRequest struct {
// contains filtered or unexported fields
}
------------ GET ------------
func (*GetLatestShortsRequest) Descriptor
deprecated
func (*GetLatestShortsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetLatestShortsRequest.ProtoReflect.Descriptor instead.
func (*GetLatestShortsRequest) ProtoMessage ¶
func (*GetLatestShortsRequest) ProtoMessage()
func (*GetLatestShortsRequest) ProtoReflect ¶
func (x *GetLatestShortsRequest) ProtoReflect() protoreflect.Message
func (*GetLatestShortsRequest) Reset ¶
func (x *GetLatestShortsRequest) Reset()
func (*GetLatestShortsRequest) String ¶
func (x *GetLatestShortsRequest) String() string
type GetShortsResponse ¶
type GetShortsResponse struct {
// contains filtered or unexported fields
}
func (*GetShortsResponse) Descriptor
deprecated
func (*GetShortsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetShortsResponse.ProtoReflect.Descriptor instead.
func (*GetShortsResponse) ProtoMessage ¶
func (*GetShortsResponse) ProtoMessage()
func (*GetShortsResponse) ProtoReflect ¶
func (x *GetShortsResponse) ProtoReflect() protoreflect.Message
func (*GetShortsResponse) Reset ¶
func (x *GetShortsResponse) Reset()
func (*GetShortsResponse) String ¶
func (x *GetShortsResponse) String() string
type ShortsDetails ¶
type ShortsDetails struct { ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=shorted.service.shorts.v1.Status" json:"status,omitempty"` // contains filtered or unexported fields }
CollectDetails contains the set of information for a given collected source.
func (*ShortsDetails) Descriptor
deprecated
func (*ShortsDetails) Descriptor() ([]byte, []int)
Deprecated: Use ShortsDetails.ProtoReflect.Descriptor instead.
func (*ShortsDetails) GetApiVersion ¶
func (x *ShortsDetails) GetApiVersion() string
func (*ShortsDetails) GetStatus ¶
func (x *ShortsDetails) GetStatus() Status
func (*ShortsDetails) ProtoMessage ¶
func (*ShortsDetails) ProtoMessage()
func (*ShortsDetails) ProtoReflect ¶
func (x *ShortsDetails) ProtoReflect() protoreflect.Message
func (*ShortsDetails) Reset ¶
func (x *ShortsDetails) Reset()
func (*ShortsDetails) String ¶
func (x *ShortsDetails) String() string
type ShortsServiceClient ¶
type ShortsServiceClient interface { // A unary RPC used to collect a source GetShortsLatest(ctx context.Context, in *GetLatestShortsRequest, opts ...grpc.CallOption) (*GetShortsResponse, error) }
ShortsServiceClient is the client API for ShortsService 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 NewShortsServiceClient ¶
func NewShortsServiceClient(cc grpc.ClientConnInterface) ShortsServiceClient
type ShortsServiceServer ¶
type ShortsServiceServer interface { // A unary RPC used to collect a source GetShortsLatest(context.Context, *GetLatestShortsRequest) (*GetShortsResponse, error) // contains filtered or unexported methods }
ShortsServiceServer is the server API for ShortsService service. All implementations must embed UnimplementedShortsServiceServer for forward compatibility
type Status ¶
type Status int32
SyncStatus specifies the state of a given synchronisation request. Where a synchronisation state will correspond to a specfic source
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 UnimplementedShortsServiceServer ¶
type UnimplementedShortsServiceServer struct { }
UnimplementedShortsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedShortsServiceServer) GetShortsLatest ¶
func (UnimplementedShortsServiceServer) GetShortsLatest(context.Context, *GetLatestShortsRequest) (*GetShortsResponse, error)
type UnsafeShortsServiceServer ¶
type UnsafeShortsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeShortsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ShortsServiceServer will result in compilation errors.