Documentation
¶
Overview ¶
Package share is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterShareHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterShareHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShareClient) error
- func RegisterShareHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterShareHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShareServer) error
- func RegisterShareServer(s grpc.ServiceRegistrar, srv ShareServer)
- type ShareClient
- type ShareServer
- type UnimplementedShareServer
- type UnsafeShareServer
- type UploadRequest
- func (*UploadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UploadRequest) GetDescription() string
- func (x *UploadRequest) GetProfile() []byte
- func (m *UploadRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *UploadRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *UploadRequest) MarshalVT() (dAtA []byte, err error)
- func (*UploadRequest) ProtoMessage()
- func (x *UploadRequest) ProtoReflect() protoreflect.Message
- func (x *UploadRequest) Reset()
- func (m *UploadRequest) SizeVT() (n int)
- func (x *UploadRequest) String() string
- func (m *UploadRequest) UnmarshalVT(dAtA []byte) error
- type UploadResponse
- func (*UploadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UploadResponse) GetId() string
- func (x *UploadResponse) GetLink() string
- func (m *UploadResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *UploadResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *UploadResponse) MarshalVT() (dAtA []byte, err error)
- func (*UploadResponse) ProtoMessage()
- func (x *UploadResponse) ProtoReflect() protoreflect.Message
- func (x *UploadResponse) Reset()
- func (m *UploadResponse) SizeVT() (n int)
- func (x *UploadResponse) String() string
- func (m *UploadResponse) UnmarshalVT(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
ShareServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Upload", Handler: _Share_Upload_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "share/share.proto", }ServiceName: "polarsignals.share.Share", HandlerType: (*
Share_ServiceDesc is the grpc.ServiceDesc for Share service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterShareHandler ¶
RegisterShareHandler registers the http handlers for service Share to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterShareHandlerClient ¶
func RegisterShareHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShareClient) error
RegisterShareHandlerClient registers the http handlers for service Share to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ShareClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ShareClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ShareClient" to call the correct interceptors.
func RegisterShareHandlerFromEndpoint ¶
func RegisterShareHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterShareHandlerFromEndpoint is same as RegisterShareHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterShareHandlerServer ¶
func RegisterShareHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShareServer) error
RegisterShareHandlerServer registers the http handlers for service Share to "mux". UnaryRPC :call ShareServer 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 RegisterShareHandlerFromEndpoint instead.
func RegisterShareServer ¶
func RegisterShareServer(s grpc.ServiceRegistrar, srv ShareServer)
Types ¶
type ShareClient ¶
type ShareClient interface { context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) }Upload(ctx
ShareClient is the client API for Share 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 NewShareClient ¶
func NewShareClient(cc grpc.ClientConnInterface) ShareClient
type ShareServer ¶
type ShareServer interface { context.Context, *UploadRequest) (*UploadResponse, error) // contains filtered or unexported methods }Upload(
ShareServer is the server API for Share service. All implementations must embed UnimplementedShareServer for forward compatibility
type UnimplementedShareServer ¶
type UnimplementedShareServer struct { }
UnimplementedShareServer must be embedded to have forward compatible implementations.
func (UnimplementedShareServer) Upload ¶
func (UnimplementedShareServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error)
type UnsafeShareServer ¶
type UnsafeShareServer interface {
// contains filtered or unexported methods
}
UnsafeShareServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ShareServer will result in compilation errors.
type UploadRequest ¶
type UploadRequest struct { // pprof bytes of the profile to be uploaded. Profile []byte `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` // Description of the profile. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
UploadRequest represents the request with profile bytes and description.
func (*UploadRequest) Descriptor
deprecated
func (*UploadRequest) Descriptor() ([]byte, []int)
Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.
func (*UploadRequest) GetDescription ¶
func (x *UploadRequest) GetDescription() string
func (*UploadRequest) GetProfile ¶
func (x *UploadRequest) GetProfile() []byte
func (*UploadRequest) MarshalToSizedBufferVT ¶
func (m *UploadRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*UploadRequest) MarshalToVT ¶
func (m *UploadRequest) MarshalToVT(dAtA []byte) (int, error)
func (*UploadRequest) MarshalVT ¶
func (m *UploadRequest) MarshalVT() (dAtA []byte, err error)
func (*UploadRequest) ProtoMessage ¶
func (*UploadRequest) ProtoMessage()
func (*UploadRequest) ProtoReflect ¶
func (x *UploadRequest) ProtoReflect() protoreflect.Message
func (*UploadRequest) Reset ¶
func (x *UploadRequest) Reset()
func (*UploadRequest) SizeVT ¶
func (m *UploadRequest) SizeVT() (n int)
func (*UploadRequest) String ¶
func (x *UploadRequest) String() string
func (*UploadRequest) UnmarshalVT ¶
func (m *UploadRequest) UnmarshalVT(dAtA []byte) error
type UploadResponse ¶
type UploadResponse struct { // id of the uploaded profile. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // link that can be used to access the profile. Link string `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` // contains filtered or unexported fields }
UploadResponse represents the response with the link that can be used to access the profile.
func (*UploadResponse) Descriptor
deprecated
func (*UploadResponse) Descriptor() ([]byte, []int)
Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.
func (*UploadResponse) GetId ¶
func (x *UploadResponse) GetId() string
func (*UploadResponse) GetLink ¶
func (x *UploadResponse) GetLink() string
func (*UploadResponse) MarshalToSizedBufferVT ¶
func (m *UploadResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*UploadResponse) MarshalToVT ¶
func (m *UploadResponse) MarshalToVT(dAtA []byte) (int, error)
func (*UploadResponse) MarshalVT ¶
func (m *UploadResponse) MarshalVT() (dAtA []byte, err error)
func (*UploadResponse) ProtoMessage ¶
func (*UploadResponse) ProtoMessage()
func (*UploadResponse) ProtoReflect ¶
func (x *UploadResponse) ProtoReflect() protoreflect.Message
func (*UploadResponse) Reset ¶
func (x *UploadResponse) Reset()
func (*UploadResponse) SizeVT ¶
func (m *UploadResponse) SizeVT() (n int)
func (*UploadResponse) String ¶
func (x *UploadResponse) String() string
func (*UploadResponse) UnmarshalVT ¶
func (m *UploadResponse) UnmarshalVT(dAtA []byte) error