common

package
v0.0.0-...-c4c90f7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const ADMIN_SERVICE_PATH = "/v1/api/admin"
View Source
const API_ROOT_PATH = "/v1/api"
View Source
const AUTH_SERVICE_PATH = "/v1/api/auth"
View Source
const DEFAULT_ADMIN_CLIENT_TIMEOUT = 30000
View Source
const DEFAULT_CLIENT_CONN_TIMEOUT = 3000
View Source
const DEFAULT_CLIENT_TIMEOUT = 10000
View Source
const DEFAULT_MAX_CLIENT_TIMEOUT = 10000
View Source
const DEFAULT_SECURE_SERVICE_ENDPOINT = "https://sds.api.xiaomi.com"
View Source
const DEFAULT_SERVICE_ENDPOINT = "http://sds.api.xiaomi.com"
View Source
const DEFAULT_THRIFT_HEADER = "application/x-thrift"
View Source
const HK_ERROR_CODE_HEADER = "X-Xiaomi-Error-Code"
View Source
const HK_REQUEST_TIMEOUT = "X-Xiaomi-Request-Timeout"
View Source
const MAX_CONTENT_SIZE = 524288
View Source
const RESTFUL_SERVICE_PATH = "/v1/api/restful"
View Source
const SCAN_COUNT = "count"
View Source
const TABLE_SERVICE_PATH = "/v1/api/table"
View Source
const THRIFT_BINARY_HEADER = "application/x-thrift-binary"
View Source
const THRIFT_BINARY_PROTOCOL_ACCELERATED_CLASS = "TBinaryProtocolAccelerated"
View Source
const THRIFT_BINARY_PROTOCOL_CLASS = "TBinaryProtocol"
View Source
const THRIFT_COMPACT_HEADER = "application/x-thrift-compact"
View Source
const THRIFT_COMPACT_PROTOCOL_CLASS = "TCompactProtocol"
View Source
const THRIFT_JSON_HEADER = "application/x-thrift-json"
View Source
const THRIFT_JSON_PROTOCOL_CLASS = "TJSONProtocol"

Variables

View Source
var GetServerTimeResult_Success_DEFAULT int64
View Source
var GetServerVersionResult_Se_DEFAULT *errors.ServiceException
View Source
var GoUnusedProtection__ int
View Source
var HEADER_THRIFT_MAP map[string]ThriftProtocol
View Source
var THRIFT_HEADER_MAP map[ThriftProtocol]string
View Source
var THRIFT_PROTOCOL_MAP map[ThriftProtocol]string
View Source
var ValidateClientVersionResult_Se_DEFAULT *errors.ServiceException
View Source
var Version_Comments_DEFAULT string = ""
View Source
var Version_Major_DEFAULT int32 = 1
View Source
var Version_Minor_DEFAULT int32 = 0
View Source
var Version_Patch_DEFAULT string = "328cff44"

Functions

This section is empty.

Types

type BaseService

type BaseService interface {

	// 获取服务端版本
	GetServerVersion() (r *Version, err error)
	// 检查版本兼容性
	//
	// Parameters:
	//  - ClientVersion
	ValidateClientVersion(clientVersion *Version) (err error)
	// 获取服务器端当前时间,1970/0/0开始的秒数,可用作ping检查联通性
	GetServerTime() (r int64, err error)
}

type BaseServiceClient

type BaseServiceClient struct {
	Transport       thrift.TTransport
	ProtocolFactory thrift.TProtocolFactory
	InputProtocol   thrift.TProtocol
	OutputProtocol  thrift.TProtocol
	SeqId           int32
}

结构化存储基础接口

func NewBaseServiceClientProtocol

func NewBaseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BaseServiceClient

func (*BaseServiceClient) GetServerTime

func (p *BaseServiceClient) GetServerTime() (r int64, err error)

获取服务器端当前时间,1970/0/0开始的秒数,可用作ping检查联通性

func (*BaseServiceClient) GetServerVersion

func (p *BaseServiceClient) GetServerVersion() (r *Version, err error)

获取服务端版本

func (*BaseServiceClient) ValidateClientVersion

func (p *BaseServiceClient) ValidateClientVersion(clientVersion *Version) (err error)

检查版本兼容性

Parameters:

  • ClientVersion

type BaseServiceProcessor

type BaseServiceProcessor struct {
	// contains filtered or unexported fields
}

func NewBaseServiceProcessor

func NewBaseServiceProcessor(handler BaseService) *BaseServiceProcessor

func (*BaseServiceProcessor) AddToProcessorMap

func (p *BaseServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)

func (*BaseServiceProcessor) GetProcessorFunction

func (p *BaseServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)

func (*BaseServiceProcessor) Process

func (p *BaseServiceProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)

func (*BaseServiceProcessor) ProcessorMap

func (p *BaseServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction

type GetServerTimeArgs

type GetServerTimeArgs struct {
}

func NewGetServerTimeArgs

func NewGetServerTimeArgs() *GetServerTimeArgs

func (*GetServerTimeArgs) Read

func (p *GetServerTimeArgs) Read(iprot thrift.TProtocol) error

func (*GetServerTimeArgs) String

func (p *GetServerTimeArgs) String() string

func (*GetServerTimeArgs) Write

func (p *GetServerTimeArgs) Write(oprot thrift.TProtocol) error

type GetServerTimeResult

type GetServerTimeResult struct {
	Success *int64 `thrift:"success,0" json:"success"`
}

func NewGetServerTimeResult

func NewGetServerTimeResult() *GetServerTimeResult

func (*GetServerTimeResult) GetSuccess

func (p *GetServerTimeResult) GetSuccess() int64

func (*GetServerTimeResult) IsSetSuccess

func (p *GetServerTimeResult) IsSetSuccess() bool

func (*GetServerTimeResult) Read

func (p *GetServerTimeResult) Read(iprot thrift.TProtocol) error

func (*GetServerTimeResult) ReadField0

func (p *GetServerTimeResult) ReadField0(iprot thrift.TProtocol) error

func (*GetServerTimeResult) String

func (p *GetServerTimeResult) String() string

func (*GetServerTimeResult) Write

func (p *GetServerTimeResult) Write(oprot thrift.TProtocol) error

type GetServerVersionArgs

type GetServerVersionArgs struct {
}

func NewGetServerVersionArgs

func NewGetServerVersionArgs() *GetServerVersionArgs

func (*GetServerVersionArgs) Read

func (p *GetServerVersionArgs) Read(iprot thrift.TProtocol) error

func (*GetServerVersionArgs) String

func (p *GetServerVersionArgs) String() string

func (*GetServerVersionArgs) Write

func (p *GetServerVersionArgs) Write(oprot thrift.TProtocol) error

type GetServerVersionResult

type GetServerVersionResult struct {
	Success *Version                 `thrift:"success,0" json:"success"`
	Se      *errors.ServiceException `thrift:"se,1" json:"se"`
}

func NewGetServerVersionResult

func NewGetServerVersionResult() *GetServerVersionResult

func (*GetServerVersionResult) GetSe

func (*GetServerVersionResult) GetSuccess

func (p *GetServerVersionResult) GetSuccess() *Version

func (*GetServerVersionResult) IsSetSe

func (p *GetServerVersionResult) IsSetSe() bool

func (*GetServerVersionResult) IsSetSuccess

func (p *GetServerVersionResult) IsSetSuccess() bool

func (*GetServerVersionResult) Read

func (*GetServerVersionResult) ReadField0

func (p *GetServerVersionResult) ReadField0(iprot thrift.TProtocol) error

func (*GetServerVersionResult) ReadField1

func (p *GetServerVersionResult) ReadField1(iprot thrift.TProtocol) error

func (*GetServerVersionResult) String

func (p *GetServerVersionResult) String() string

func (*GetServerVersionResult) Write

func (p *GetServerVersionResult) Write(oprot thrift.TProtocol) error

type ThriftProtocol

type ThriftProtocol int64

thrift传输协议

const (
	ThriftProtocol_TCOMPACT           ThriftProtocol = 0
	ThriftProtocol_TJSON              ThriftProtocol = 1
	ThriftProtocol_TBINARY            ThriftProtocol = 2
	ThriftProtocol_TBINARYACCELERATED ThriftProtocol = 3
)

func ThriftProtocolFromString

func ThriftProtocolFromString(s string) (ThriftProtocol, error)

func ThriftProtocolPtr

func ThriftProtocolPtr(v ThriftProtocol) *ThriftProtocol

func (ThriftProtocol) String

func (p ThriftProtocol) String() string

type ValidateClientVersionArgs

type ValidateClientVersionArgs struct {
	ClientVersion *Version `thrift:"clientVersion,1" json:"clientVersion"`
}

func NewValidateClientVersionArgs

func NewValidateClientVersionArgs() *ValidateClientVersionArgs

func (*ValidateClientVersionArgs) GetClientVersion

func (p *ValidateClientVersionArgs) GetClientVersion() *Version

func (*ValidateClientVersionArgs) IsSetClientVersion

func (p *ValidateClientVersionArgs) IsSetClientVersion() bool

func (*ValidateClientVersionArgs) Read

func (*ValidateClientVersionArgs) ReadField1

func (p *ValidateClientVersionArgs) ReadField1(iprot thrift.TProtocol) error

func (*ValidateClientVersionArgs) String

func (p *ValidateClientVersionArgs) String() string

func (*ValidateClientVersionArgs) Write

type ValidateClientVersionResult

type ValidateClientVersionResult struct {
	Se *errors.ServiceException `thrift:"se,1" json:"se"`
}

func NewValidateClientVersionResult

func NewValidateClientVersionResult() *ValidateClientVersionResult

func (*ValidateClientVersionResult) GetSe

func (*ValidateClientVersionResult) IsSetSe

func (p *ValidateClientVersionResult) IsSetSe() bool

func (*ValidateClientVersionResult) Read

func (*ValidateClientVersionResult) ReadField1

func (p *ValidateClientVersionResult) ReadField1(iprot thrift.TProtocol) error

func (*ValidateClientVersionResult) String

func (p *ValidateClientVersionResult) String() string

func (*ValidateClientVersionResult) Write

type Version

type Version struct {
	Major    int32  `thrift:"major,1" json:"major"`
	Minor    int32  `thrift:"minor,2" json:"minor"`
	Patch    string `thrift:"patch,3" json:"patch"`
	Comments string `thrift:"comments,4" json:"comments"`
}
var GetServerVersionResult_Success_DEFAULT *Version
var ValidateClientVersionArgs_ClientVersion_DEFAULT *Version

func NewVersion

func NewVersion() *Version

func (*Version) GetComments

func (p *Version) GetComments() string

func (*Version) GetMajor

func (p *Version) GetMajor() int32

func (*Version) GetMinor

func (p *Version) GetMinor() int32

func (*Version) GetPatch

func (p *Version) GetPatch() string

func (*Version) IsSetComments

func (p *Version) IsSetComments() bool

func (*Version) IsSetMajor

func (p *Version) IsSetMajor() bool

func (*Version) IsSetMinor

func (p *Version) IsSetMinor() bool

func (*Version) IsSetPatch

func (p *Version) IsSetPatch() bool

func (*Version) Read

func (p *Version) Read(iprot thrift.TProtocol) error

func (*Version) ReadField1

func (p *Version) ReadField1(iprot thrift.TProtocol) error

func (*Version) ReadField2

func (p *Version) ReadField2(iprot thrift.TProtocol) error

func (*Version) ReadField3

func (p *Version) ReadField3(iprot thrift.TProtocol) error

func (*Version) ReadField4

func (p *Version) ReadField4(iprot thrift.TProtocol) error

func (*Version) String

func (p *Version) String() string

func (*Version) Write

func (p *Version) Write(oprot thrift.TProtocol) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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