Documentation ¶
Overview ¶
Package response is the response of service
Index ¶
- type BaseGenericResponse
- func (r *BaseGenericResponse) GetAction() string
- func (r *BaseGenericResponse) GetMessage() string
- func (r BaseGenericResponse) GetPayload() map[string]interface{}
- func (r *BaseGenericResponse) GetRetCode() int
- func (r *BaseGenericResponse) SetPayload(m map[string]interface{}) error
- func (r BaseGenericResponse) Unmarshal(resp interface{}) error
- type Common
- type CommonBase
- func (c *CommonBase) GetAction() string
- func (c *CommonBase) GetMessage() string
- func (c *CommonBase) GetRequest() request.Common
- func (c *CommonBase) GetRequestUUID() string
- func (c *CommonBase) GetRetCode() int
- func (c *CommonBase) SetRequest(req request.Common)
- func (c *CommonBase) SetRequestUUID(uuid string)
- type GenericResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseGenericResponse ¶ added in v0.14.0
type BaseGenericResponse struct { CommonBase // contains filtered or unexported fields }
func (*BaseGenericResponse) GetAction ¶ added in v0.14.0
func (r *BaseGenericResponse) GetAction() string
func (*BaseGenericResponse) GetMessage ¶ added in v0.14.0
func (r *BaseGenericResponse) GetMessage() string
func (BaseGenericResponse) GetPayload ¶ added in v0.14.0
func (r BaseGenericResponse) GetPayload() map[string]interface{}
func (*BaseGenericResponse) GetRetCode ¶ added in v0.14.0
func (r *BaseGenericResponse) GetRetCode() int
func (*BaseGenericResponse) SetPayload ¶ added in v0.14.0
func (r *BaseGenericResponse) SetPayload(m map[string]interface{}) error
func (BaseGenericResponse) Unmarshal ¶ added in v0.14.0
func (r BaseGenericResponse) Unmarshal(resp interface{}) error
type Common ¶
type Common interface { GetRetCode() int GetMessage() string GetAction() string GetRequest() request.Common SetRequest(request.Common) SetRequestUUID(string) GetRequestUUID() string }
Common describe a response of action, it is only used for ucloud open api v1 via HTTP GET and action parameters.
type CommonBase ¶
type CommonBase struct { Action string RetCode int Message string // contains filtered or unexported fields }
CommonBase has common attribute and method, it also implement ActionResponse interface.
func (*CommonBase) GetAction ¶
func (c *CommonBase) GetAction() string
GetAction will return the request action of ucloud api
func (*CommonBase) GetMessage ¶
func (c *CommonBase) GetMessage() string
GetMessage will return the error message of ucloud api
func (*CommonBase) GetRequest ¶ added in v0.8.4
func (c *CommonBase) GetRequest() request.Common
GetRequest will return the latest retried request of current action
func (*CommonBase) GetRequestUUID ¶ added in v0.9.0
func (c *CommonBase) GetRequestUUID() string
GetRequestUUID will get uuid of request
func (*CommonBase) GetRetCode ¶
func (c *CommonBase) GetRetCode() int
GetRetCode will return the error code of ucloud api Error is non-zero and success is zero
func (*CommonBase) SetRequest ¶ added in v0.8.4
func (c *CommonBase) SetRequest(req request.Common)
GetRequest will return the latest retried request of current action
func (*CommonBase) SetRequestUUID ¶ added in v0.9.0
func (c *CommonBase) SetRequestUUID(uuid string)
SetRequestUUID will set uuid of request