Documentation ¶
Index ¶
- Variables
- func Apply(ctx context.Context, req, method string, param Param, target any) error
- type Error
- type Param
- type Response
- func (r *Response) Apply(v any) error
- func (r *Response) ApplyContext(ctx context.Context, v any) error
- func (r *Response) Get(v string) (any, error)
- func (r *Response) GetString(v string) (string, error)
- func (r *Response) ReadValue(ctx context.Context) (any, error)
- func (r *Response) Value() (any, error)
- func (r *Response) ValueContext(ctx context.Context) (any, error)
- type RouterType
- type SenderInterface
- type Time
- type Token
- type UploadInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Debug = false Scheme = "https" Host = "www.atonline.com" )
View Source
var ( ErrNoClientID = errors.New("no client_id has been provided for token renewal") ErrNoRefreshToken = errors.New("no refresh token is available and access token has expired") )
View Source
var RestHttpClient = &http.Client{ Transport: RestHttpTransport, Timeout: 120 * time.Second, }
View Source
var RestHttpTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }
View Source
var ( SystemProxy = &httputil.ReverseProxy{ Director: systemProxyDirector, Transport: RestHttpClient.Transport, } )
Functions ¶
Types ¶
type Response ¶ added in v0.2.2
type Response struct { Result string `json:"result"` // "success" or "error" (or "redirect") Data pjson.RawMessage `json:"data,omitempty"` Error string `json:"error,omitempty"` Code int `json:"code,omitempty"` // for errors Extra string `json:"extra,omitempty"` Token string `json:"token,omitempty"` Paging any `json:"paging,omitempty"` Job any `json:"job,omitempty"` Time any `json:"time,omitempty"` Access any `json:"access,omitempty"` RedirectUrl string `json:"redirect_url,omitempty"` RedirectCode int `json:"redirect_code,omitempty"` // contains filtered or unexported fields }
func (*Response) ApplyContext ¶ added in v0.5.3
type RouterType ¶ added in v0.1.3
type RouterType struct { }
var Router *RouterType = &RouterType{}
func (*RouterType) ServeHTTP ¶ added in v0.1.3
func (h *RouterType) ServeHTTP(w http.ResponseWriter, req *http.Request)
type SenderInterface ¶ added in v0.5.1
var Sender SenderInterface = restSender{}
type Time ¶ added in v0.1.4
func (Time) MarshalContextJSON ¶ added in v0.5.3
func (Time) MarshalJSON ¶ added in v0.3.0
func (*Time) UnmarshalContextJSON ¶ added in v0.5.3
func (*Time) UnmarshalJSON ¶ added in v0.3.0
type Token ¶ added in v0.2.0
type UploadInfo ¶ added in v0.4.0
type UploadInfo struct { MaxPartSize int64 // maximum size of a single part in MB, defaults to 1024 (1GB) ParallelUploads int // number of parallel uploads to perform (defaults to 3) // contains filtered or unexported fields }
func PrepareUpload ¶ added in v0.4.0
func PrepareUpload(req map[string]any) (*UploadInfo, error)
upload for platform files
func (*UploadInfo) String ¶ added in v0.4.0
func (u *UploadInfo) String() string
Click to show internal directories.
Click to hide internal directories.