Documentation ¶
Overview ¶
Package api_cos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterCosHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCosHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CosClient) error
- func RegisterCosHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCosHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CosServer) error
- func RegisterCosServer(s grpc.ServiceRegistrar, srv CosServer)
- type CosBucketURLReq
- type CosBucketURLResObj
- func (*CosBucketURLResObj) Descriptor() ([]byte, []int)deprecated
- func (x *CosBucketURLResObj) GetBucketURL() string
- func (*CosBucketURLResObj) ProtoMessage()
- func (x *CosBucketURLResObj) ProtoReflect() protoreflect.Message
- func (x *CosBucketURLResObj) Reset()
- func (x *CosBucketURLResObj) String() string
- type CosBucketURLResp
- func (*CosBucketURLResp) Descriptor() ([]byte, []int)deprecated
- func (x *CosBucketURLResp) GetCode() int64
- func (x *CosBucketURLResp) GetData() *CosBucketURLResObj
- func (x *CosBucketURLResp) GetMsg() string
- func (*CosBucketURLResp) ProtoMessage()
- func (x *CosBucketURLResp) ProtoReflect() protoreflect.Message
- func (x *CosBucketURLResp) Reset()
- func (x *CosBucketURLResp) String() string
- type CosClient
- type CosGetReq
- type CosGetResObj
- type CosGetResp
- func (*CosGetResp) Descriptor() ([]byte, []int)deprecated
- func (x *CosGetResp) GetCode() int64
- func (x *CosGetResp) GetData() *CosGetResObj
- func (x *CosGetResp) GetMsg() string
- func (*CosGetResp) ProtoMessage()
- func (x *CosGetResp) ProtoReflect() protoreflect.Message
- func (x *CosGetResp) Reset()
- func (x *CosGetResp) String() string
- type CosPutReq
- type CosPutResObj
- type CosPutResp
- func (*CosPutResp) Descriptor() ([]byte, []int)deprecated
- func (x *CosPutResp) GetCode() int64
- func (x *CosPutResp) GetData() *CosPutResObj
- func (x *CosPutResp) GetMsg() string
- func (*CosPutResp) ProtoMessage()
- func (x *CosPutResp) ProtoReflect() protoreflect.Message
- func (x *CosPutResp) Reset()
- func (x *CosPutResp) String() string
- type CosServer
- type UnimplementedCosServer
- type UnsafeCosServer
Constants ¶
const ( Cos_CosBucketURL_FullMethodName = "/Cos/CosBucketURL" Cos_CosPut_FullMethodName = "/Cos/CosPut" Cos_CosGet_FullMethodName = "/Cos/CosGet" )
Variables ¶
var Cos_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Cos", HandlerType: (*CosServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CosBucketURL", Handler: _Cos_CosBucketURL_Handler, }, { MethodName: "CosPut", Handler: _Cos_CosPut_Handler, }, { MethodName: "CosGet", Handler: _Cos_CosGet_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cos.proto", }
Cos_ServiceDesc is the grpc.ServiceDesc for Cos service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cos_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCosHandler ¶
RegisterCosHandler registers the http handlers for service Cos to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCosHandlerClient ¶
RegisterCosHandlerClient registers the http handlers for service Cos to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CosClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CosClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CosClient" to call the correct interceptors.
func RegisterCosHandlerFromEndpoint ¶
func RegisterCosHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCosHandlerFromEndpoint is same as RegisterCosHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCosHandlerServer ¶
RegisterCosHandlerServer registers the http handlers for service Cos to "mux". UnaryRPC :call CosServer 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 RegisterCosHandlerFromEndpoint instead.
func RegisterCosServer ¶
func RegisterCosServer(s grpc.ServiceRegistrar, srv CosServer)
Types ¶
type CosBucketURLReq ¶
type CosBucketURLReq struct {
// contains filtered or unexported fields
}
func (*CosBucketURLReq) Descriptor
deprecated
func (*CosBucketURLReq) Descriptor() ([]byte, []int)
Deprecated: Use CosBucketURLReq.ProtoReflect.Descriptor instead.
func (*CosBucketURLReq) ProtoMessage ¶
func (*CosBucketURLReq) ProtoMessage()
func (*CosBucketURLReq) ProtoReflect ¶
func (x *CosBucketURLReq) ProtoReflect() protoreflect.Message
func (*CosBucketURLReq) Reset ¶
func (x *CosBucketURLReq) Reset()
func (*CosBucketURLReq) String ¶
func (x *CosBucketURLReq) String() string
type CosBucketURLResObj ¶
type CosBucketURLResObj struct { BucketURL string `protobuf:"bytes,1,opt,name=bucketURL,proto3" json:"bucketURL,omitempty"` // contains filtered or unexported fields }
CosBucketURL
func (*CosBucketURLResObj) Descriptor
deprecated
func (*CosBucketURLResObj) Descriptor() ([]byte, []int)
Deprecated: Use CosBucketURLResObj.ProtoReflect.Descriptor instead.
func (*CosBucketURLResObj) GetBucketURL ¶
func (x *CosBucketURLResObj) GetBucketURL() string
func (*CosBucketURLResObj) ProtoMessage ¶
func (*CosBucketURLResObj) ProtoMessage()
func (*CosBucketURLResObj) ProtoReflect ¶
func (x *CosBucketURLResObj) ProtoReflect() protoreflect.Message
func (*CosBucketURLResObj) Reset ¶
func (x *CosBucketURLResObj) Reset()
func (*CosBucketURLResObj) String ¶
func (x *CosBucketURLResObj) String() string
type CosBucketURLResp ¶
type CosBucketURLResp struct { Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *CosBucketURLResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CosBucketURLResp) Descriptor
deprecated
func (*CosBucketURLResp) Descriptor() ([]byte, []int)
Deprecated: Use CosBucketURLResp.ProtoReflect.Descriptor instead.
func (*CosBucketURLResp) GetCode ¶
func (x *CosBucketURLResp) GetCode() int64
func (*CosBucketURLResp) GetData ¶
func (x *CosBucketURLResp) GetData() *CosBucketURLResObj
func (*CosBucketURLResp) GetMsg ¶
func (x *CosBucketURLResp) GetMsg() string
func (*CosBucketURLResp) ProtoMessage ¶
func (*CosBucketURLResp) ProtoMessage()
func (*CosBucketURLResp) ProtoReflect ¶
func (x *CosBucketURLResp) ProtoReflect() protoreflect.Message
func (*CosBucketURLResp) Reset ¶
func (x *CosBucketURLResp) Reset()
func (*CosBucketURLResp) String ¶
func (x *CosBucketURLResp) String() string
type CosClient ¶
type CosClient interface { CosBucketURL(ctx context.Context, in *CosBucketURLReq, opts ...grpc.CallOption) (*CosBucketURLResp, error) CosPut(ctx context.Context, in *CosPutReq, opts ...grpc.CallOption) (*CosPutResp, error) CosGet(ctx context.Context, in *CosGetReq, opts ...grpc.CallOption) (*CosGetResp, error) }
CosClient is the client API for Cos 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 NewCosClient ¶
func NewCosClient(cc grpc.ClientConnInterface) CosClient
type CosGetReq ¶
type CosGetReq struct { CosURI string `protobuf:"bytes,1,opt,name=cosURI,proto3" json:"cosURI,omitempty"` // contains filtered or unexported fields }
func (*CosGetReq) Descriptor
deprecated
func (*CosGetReq) ProtoMessage ¶
func (*CosGetReq) ProtoMessage()
func (*CosGetReq) ProtoReflect ¶
func (x *CosGetReq) ProtoReflect() protoreflect.Message
type CosGetResObj ¶
type CosGetResObj struct { FileBytes []byte `protobuf:"bytes,1,opt,name=fileBytes,proto3" json:"fileBytes,omitempty"` // contains filtered or unexported fields }
CosGet
func (*CosGetResObj) Descriptor
deprecated
func (*CosGetResObj) Descriptor() ([]byte, []int)
Deprecated: Use CosGetResObj.ProtoReflect.Descriptor instead.
func (*CosGetResObj) GetFileBytes ¶
func (x *CosGetResObj) GetFileBytes() []byte
func (*CosGetResObj) ProtoMessage ¶
func (*CosGetResObj) ProtoMessage()
func (*CosGetResObj) ProtoReflect ¶
func (x *CosGetResObj) ProtoReflect() protoreflect.Message
func (*CosGetResObj) Reset ¶
func (x *CosGetResObj) Reset()
func (*CosGetResObj) String ¶
func (x *CosGetResObj) String() string
type CosGetResp ¶
type CosGetResp struct { Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *CosGetResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CosGetResp) Descriptor
deprecated
func (*CosGetResp) Descriptor() ([]byte, []int)
Deprecated: Use CosGetResp.ProtoReflect.Descriptor instead.
func (*CosGetResp) GetCode ¶
func (x *CosGetResp) GetCode() int64
func (*CosGetResp) GetData ¶
func (x *CosGetResp) GetData() *CosGetResObj
func (*CosGetResp) GetMsg ¶
func (x *CosGetResp) GetMsg() string
func (*CosGetResp) ProtoMessage ¶
func (*CosGetResp) ProtoMessage()
func (*CosGetResp) ProtoReflect ¶
func (x *CosGetResp) ProtoReflect() protoreflect.Message
func (*CosGetResp) Reset ¶
func (x *CosGetResp) Reset()
func (*CosGetResp) String ¶
func (x *CosGetResp) String() string
type CosPutReq ¶
type CosPutReq struct { FileName string `protobuf:"bytes,1,opt,name=fileName,proto3" json:"fileName,omitempty"` FileBytes []byte `protobuf:"bytes,2,opt,name=fileBytes,proto3" json:"fileBytes,omitempty"` // contains filtered or unexported fields }
func (*CosPutReq) Descriptor
deprecated
func (*CosPutReq) GetFileBytes ¶
func (*CosPutReq) GetFileName ¶
func (*CosPutReq) ProtoMessage ¶
func (*CosPutReq) ProtoMessage()
func (*CosPutReq) ProtoReflect ¶
func (x *CosPutReq) ProtoReflect() protoreflect.Message
type CosPutResObj ¶
type CosPutResObj struct { CosURI string `protobuf:"bytes,1,opt,name=cosURI,proto3" json:"cosURI,omitempty"` // contains filtered or unexported fields }
CosPut
func (*CosPutResObj) Descriptor
deprecated
func (*CosPutResObj) Descriptor() ([]byte, []int)
Deprecated: Use CosPutResObj.ProtoReflect.Descriptor instead.
func (*CosPutResObj) GetCosURI ¶
func (x *CosPutResObj) GetCosURI() string
func (*CosPutResObj) ProtoMessage ¶
func (*CosPutResObj) ProtoMessage()
func (*CosPutResObj) ProtoReflect ¶
func (x *CosPutResObj) ProtoReflect() protoreflect.Message
func (*CosPutResObj) Reset ¶
func (x *CosPutResObj) Reset()
func (*CosPutResObj) String ¶
func (x *CosPutResObj) String() string
type CosPutResp ¶
type CosPutResp struct { Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *CosPutResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CosPutResp) Descriptor
deprecated
func (*CosPutResp) Descriptor() ([]byte, []int)
Deprecated: Use CosPutResp.ProtoReflect.Descriptor instead.
func (*CosPutResp) GetCode ¶
func (x *CosPutResp) GetCode() int64
func (*CosPutResp) GetData ¶
func (x *CosPutResp) GetData() *CosPutResObj
func (*CosPutResp) GetMsg ¶
func (x *CosPutResp) GetMsg() string
func (*CosPutResp) ProtoMessage ¶
func (*CosPutResp) ProtoMessage()
func (*CosPutResp) ProtoReflect ¶
func (x *CosPutResp) ProtoReflect() protoreflect.Message
func (*CosPutResp) Reset ¶
func (x *CosPutResp) Reset()
func (*CosPutResp) String ¶
func (x *CosPutResp) String() string
type CosServer ¶
type CosServer interface { CosBucketURL(context.Context, *CosBucketURLReq) (*CosBucketURLResp, error) CosPut(context.Context, *CosPutReq) (*CosPutResp, error) CosGet(context.Context, *CosGetReq) (*CosGetResp, error) }
CosServer is the server API for Cos service. All implementations should embed UnimplementedCosServer for forward compatibility
type UnimplementedCosServer ¶
type UnimplementedCosServer struct { }
UnimplementedCosServer should be embedded to have forward compatible implementations.
func (UnimplementedCosServer) CosBucketURL ¶
func (UnimplementedCosServer) CosBucketURL(context.Context, *CosBucketURLReq) (*CosBucketURLResp, error)
func (UnimplementedCosServer) CosGet ¶
func (UnimplementedCosServer) CosGet(context.Context, *CosGetReq) (*CosGetResp, error)
func (UnimplementedCosServer) CosPut ¶
func (UnimplementedCosServer) CosPut(context.Context, *CosPutReq) (*CosPutResp, error)
type UnsafeCosServer ¶
type UnsafeCosServer interface {
// contains filtered or unexported methods
}
UnsafeCosServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CosServer will result in compilation errors.