tcloud

package
v0.0.68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_grpc_middleware_api_tcloud_v3_0_tcloud_proto protoreflect.FileDescriptor
View Source
var RequestIdKey = "X-Request-ID"

RequestIdKey is metadata key name for request ID

Functions

func GetMetadata

func GetMetadata(ctx context.Context, key string) []string

func HTTPError

func HTTPError(ctx context.Context, mux *runtime.ServeMux,
	marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)

HTTPError uses the mux-configured error handler.

func HTTPForwardResponse

func HTTPForwardResponse(ctx context.Context, r http.ResponseWriter, message proto.Message) error

cant not rewrite message, only append message to response

func UnaryServerInterceptorOfError

func UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor

UnaryServerInterceptorOfError returns a new unary server interceptors

func UnaryServerInterceptorOfRequestId

func UnaryServerInterceptorOfRequestId() grpc.UnaryServerInterceptor

UnaryServerInterceptorOfRequestId returns a new unary server interceptors with tags in context with request_id.

Types

type EmptyJSONPbOption

type EmptyJSONPbOption struct{}

EmptyJSONPbOption does not alter the configuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

type ErrorResponse

type ErrorResponse struct {
	Error     *TCloudError `protobuf:"bytes,1,opt,name=error,json=Error,proto3" json:"error,omitempty"`
	RequestId string       `protobuf:"bytes,2,opt,name=request_id,json=RequestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

ErrorResponse

func (*ErrorResponse) Descriptor deprecated

func (*ErrorResponse) Descriptor() ([]byte, []int)

Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.

func (*ErrorResponse) GetError

func (x *ErrorResponse) GetError() *TCloudError

func (*ErrorResponse) GetRequestId

func (x *ErrorResponse) GetRequestId() string

func (*ErrorResponse) ProtoMessage

func (*ErrorResponse) ProtoMessage()

func (*ErrorResponse) ProtoReflect

func (x *ErrorResponse) ProtoReflect() protoreflect.Message

func (*ErrorResponse) Reset

func (x *ErrorResponse) Reset()

func (*ErrorResponse) String

func (x *ErrorResponse) String() string

type JSONPb

type JSONPb struct {
	runtime.JSONPb
	// contains filtered or unexported fields
}

func NewDefaultJSONPb

func NewDefaultJSONPb() *JSONPb

func NewJSONPb

func NewJSONPb(options ...JSONPbOption) *JSONPb

func (*JSONPb) ApplyOptions

func (o *JSONPb) ApplyOptions(options ...JSONPbOption) *JSONPb

func (*JSONPb) Marshal

func (j *JSONPb) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" into JSON.

type JSONPbOption

type JSONPbOption interface {
	// contains filtered or unexported methods
}

A JSONPbOption sets options.

func WithDiscardUnknown

func WithDiscardUnknown(discardUnknown bool) JSONPbOption

func WithEmitUnpopulated

func WithEmitUnpopulated(emitUnpopulated bool) JSONPbOption

func WithIndent

func WithIndent(indent string) JSONPbOption

func WithUseEnumNumbers

func WithUseEnumNumbers(useEnumNumbers bool) JSONPbOption

func WithUseProtoNames

func WithUseProtoNames(useProtoNames bool) JSONPbOption

type JSONPbOptionFunc

type JSONPbOptionFunc func(*JSONPb)

JSONPbOptionFunc wraps a function that modifies Client into an implementation of the JSONPbOption interface.

type RequestIdRetriever

type RequestIdRetriever interface {
	GetRequestId() string
}

type TCloudBaseRequest

type TCloudBaseRequest struct {
	HttpMethod string            `protobuf:"bytes,1,opt,name=http_method,json=httpMethod,proto3" json:"http_method,omitempty"`
	Scheme     string            `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"`
	RootDomain string            `protobuf:"bytes,3,opt,name=root_domain,json=rootDomain,proto3" json:"root_domain,omitempty"`
	Domain     string            `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"`
	Path       string            `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	Params     map[string]string `` /* 153-byte string literal not displayed */
	FormParams map[string]string `` /* 179-byte string literal not displayed */
	Service    string            `protobuf:"bytes,8,opt,name=service,proto3" json:"service,omitempty"`
	Version    string            `protobuf:"bytes,9,opt,name=version,json=Version,proto3" json:"version,omitempty"`
	Action     string            `protobuf:"bytes,10,opt,name=action,json=Action,proto3" json:"action,omitempty"`
	// contains filtered or unexported fields
}

github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go

func (*TCloudBaseRequest) Descriptor deprecated

func (*TCloudBaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use TCloudBaseRequest.ProtoReflect.Descriptor instead.

func (*TCloudBaseRequest) GetAction

func (x *TCloudBaseRequest) GetAction() string

func (*TCloudBaseRequest) GetDomain

func (x *TCloudBaseRequest) GetDomain() string

func (*TCloudBaseRequest) GetFormParams

func (x *TCloudBaseRequest) GetFormParams() map[string]string

func (*TCloudBaseRequest) GetHttpMethod

func (x *TCloudBaseRequest) GetHttpMethod() string

func (*TCloudBaseRequest) GetParams

func (x *TCloudBaseRequest) GetParams() map[string]string

func (*TCloudBaseRequest) GetPath

func (x *TCloudBaseRequest) GetPath() string

func (*TCloudBaseRequest) GetRootDomain

func (x *TCloudBaseRequest) GetRootDomain() string

func (*TCloudBaseRequest) GetScheme

func (x *TCloudBaseRequest) GetScheme() string

func (*TCloudBaseRequest) GetService

func (x *TCloudBaseRequest) GetService() string

func (*TCloudBaseRequest) GetVersion

func (x *TCloudBaseRequest) GetVersion() string

func (*TCloudBaseRequest) ProtoMessage

func (*TCloudBaseRequest) ProtoMessage()

func (*TCloudBaseRequest) ProtoReflect

func (x *TCloudBaseRequest) ProtoReflect() protoreflect.Message

func (*TCloudBaseRequest) Reset

func (x *TCloudBaseRequest) Reset()

func (*TCloudBaseRequest) String

func (x *TCloudBaseRequest) String() string

type TCloudError

type TCloudError struct {
	Code    string `protobuf:"bytes,1,opt,name=code,json=Code,proto3" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,json=Message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*TCloudError) Descriptor deprecated

func (*TCloudError) Descriptor() ([]byte, []int)

Deprecated: Use TCloudError.ProtoReflect.Descriptor instead.

func (*TCloudError) GetCode

func (x *TCloudError) GetCode() string

func (*TCloudError) GetMessage

func (x *TCloudError) GetMessage() string

func (*TCloudError) ProtoMessage

func (*TCloudError) ProtoMessage()

func (*TCloudError) ProtoReflect

func (x *TCloudError) ProtoReflect() protoreflect.Message

func (*TCloudError) Reset

func (x *TCloudError) Reset()

func (*TCloudError) String

func (x *TCloudError) String() string

type TCloudErrorResponse

type TCloudErrorResponse struct {

	// ErrorResponse
	Response *ErrorResponse `protobuf:"bytes,1,opt,name=response,json=Response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*TCloudErrorResponse) Descriptor deprecated

func (*TCloudErrorResponse) Descriptor() ([]byte, []int)

Deprecated: Use TCloudErrorResponse.ProtoReflect.Descriptor instead.

func (*TCloudErrorResponse) GetResponse

func (x *TCloudErrorResponse) GetResponse() *ErrorResponse

func (*TCloudErrorResponse) ProtoMessage

func (*TCloudErrorResponse) ProtoMessage()

func (*TCloudErrorResponse) ProtoReflect

func (x *TCloudErrorResponse) ProtoReflect() protoreflect.Message

func (*TCloudErrorResponse) Reset

func (x *TCloudErrorResponse) Reset()

func (*TCloudErrorResponse) String

func (x *TCloudErrorResponse) String() string

type TCloudResponse

type TCloudResponse struct {
	Response *_struct.Struct `protobuf:"bytes,1,opt,name=response,json=Response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

https://github.com/TencentCloud/tencentcloud-sdk-go/blob/master/tencentcloud/common/http/response.go

func (*TCloudResponse) Descriptor deprecated

func (*TCloudResponse) Descriptor() ([]byte, []int)

Deprecated: Use TCloudResponse.ProtoReflect.Descriptor instead.

func (*TCloudResponse) GetResponse

func (x *TCloudResponse) GetResponse() *_struct.Struct

func (*TCloudResponse) ProtoMessage

func (*TCloudResponse) ProtoMessage()

func (*TCloudResponse) ProtoReflect

func (x *TCloudResponse) ProtoReflect() protoreflect.Message

func (*TCloudResponse) Reset

func (x *TCloudResponse) Reset()

func (*TCloudResponse) String

func (x *TCloudResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL