Documentation
¶
Index ¶
- Variables
- func Apply(ctx context.Context, req, method string, param Param, target interface{}) error
- func RedirectError(u *url.URL) error
- func RedirectErrorCode(u *url.URL, code int) error
- func SendRedirect(w http.ResponseWriter, url string, code int)
- type Error
- type Param
- type Response
- type RouterType
- type Time
- type Token
- type UploadInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Debug = false 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: &http.Transport{ Proxy: http.ProxyFromEnvironment, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }, Timeout: 120 * time.Second, }
View Source
var ( SystemProxy = &httputil.ReverseProxy{ Director: systemProxyDirector, Transport: RestHttpClient.Transport, } )
Functions ¶
func RedirectError ¶
func RedirectErrorCode ¶
code can be one of http.StatusMovedPermanently or http.StatusFound or any 3xx http status code
func SendRedirect ¶
func SendRedirect(w http.ResponseWriter, url string, code int)
Types ¶
type Response ¶ added in v0.2.2
type Response struct {
Result string `json:"result"` // "success" or "error" (or "redirect")
Data json.RawMessage `json:"data"`
Error string `json:"error"`
Extra string `json:"extra"`
Token string `json:"token"`
Paging interface{} `json:"paging"`
Job interface{} `json:"job"`
Time interface{} `json:"time"`
Access interface{} `json:"access"`
RedirectUrl string `json:"redirect_url"`
RedirectCode int `json:"redirect_code"`
}
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 Time ¶ added in v0.1.4
func (Time) MarshalJSON ¶ added in v0.3.0
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 {
// contains filtered or unexported fields
}
func PrepareUpload ¶ added in v0.4.0
func PrepareUpload(req map[string]interface{}) (*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.