Documentation ¶
Index ¶
- Constants
- func AsyncExecute(runnable func())
- func IsNetError(err error) bool
- func IsTimeoutError(err error) bool
- func VolcSign(req *fasthttp.Request, cred Credential) *fasthttp.Request
- type Context
- func (receiver *Context) AK() string
- func (receiver *Context) CustomerHeaders() map[string]string
- func (receiver *Context) HostAvailablerConfig() *HostAvailablerConfig
- func (receiver *Context) HostHeader() string
- func (receiver *Context) Hosts() []string
- func (receiver *Context) MetricsConfig() *metrics.Config
- func (receiver *Context) SK() string
- func (receiver *Context) Schema() string
- func (receiver *Context) Tenant() string
- func (receiver *Context) TenantId() string
- func (receiver *Context) Token() string
- func (receiver *Context) UseAirAuth() bool
- func (receiver *Context) UseVolcAuth() bool
- type ContextParam
- type Credential
- type HTTPCaller
- type HostAvailabler
- type HostAvailablerConfig
- type Region
- type URLCenter
Constants ¶
View Source
const ( MaxWriteItemCount = 2000 MaxImportItemCount = 10000 // StatusCodeSuccess The request was executed successfully without any exception StatusCodeSuccess = 0 // StatusCodeIdempotent A Request with the same "Request-ID" was already received. This Request was rejected StatusCodeIdempotent = 409 // StatusCodeOperationLoss Operation information is missing due to an unknown exception StatusCodeOperationLoss = 410 // StatusCodeTooManyRequest The server hope slow down request frequency, and this request was rejected StatusCodeTooManyRequest = 429 )
Variables ¶
This section is empty.
Functions ¶
func AsyncExecute ¶
func AsyncExecute(runnable func())
func IsNetError ¶
func IsTimeoutError ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(param *ContextParam) (*Context, error)
func (*Context) CustomerHeaders ¶
func (*Context) HostAvailablerConfig ¶ added in v0.1.16
func (receiver *Context) HostAvailablerConfig() *HostAvailablerConfig
func (*Context) HostHeader ¶
func (*Context) MetricsConfig ¶ added in v0.1.16
func (*Context) UseAirAuth ¶
func (*Context) UseVolcAuth ¶
type ContextParam ¶
type Credential ¶
type HTTPCaller ¶ added in v0.1.10
type HTTPCaller struct {
// contains filtered or unexported fields
}
func NewHTTPCaller ¶ added in v0.1.10
func NewHTTPCaller(context *Context) *HTTPCaller
func (*HTTPCaller) DoJSONRequest ¶ added in v0.1.10
type HostAvailabler ¶
type HostAvailabler struct {
// contains filtered or unexported fields
}
func NewHostAvailabler ¶
func NewHostAvailabler(urlCenter URLCenter, context *Context) *HostAvailabler
func (*HostAvailabler) GetHost ¶ added in v0.1.16
func (receiver *HostAvailabler) GetHost() string
func (*HostAvailabler) Shutdown ¶
func (receiver *HostAvailabler) Shutdown()
type HostAvailablerConfig ¶ added in v0.1.16
type HostAvailablerConfig struct { // host availabler used to test the latency, example {}://%s/predict/api/ping // {} will be replaced by schema which set in context // %s will be dynamically formatted by hosts PingUrlFormat string // record the window size of each host's test status WindowSize int // timeout for requesting hosts PingTimeout time.Duration // The time interval for pingHostAvailabler to do ping PingInterval time.Duration }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.