Documentation ¶
Index ¶
- Constants
- Variables
- func HandleVersion(w http.ResponseWriter, r *http.Request)
- func Handler(ctx context.Context, req events.APIGatewayRequest) (events.APIGatewayResponse, error)
- func HandlerChi(ctx context.Context, req events.APIGatewayRequest) (events.APIGatewayResponse, error)
- func RunChi(r *chi.Mux)
- func RunTencentChi(r *chi.Mux)
- func RunTencentChiWithSwagger(r *chi.Mux, project string)
- func RunTencentGin(r *gin.Engine)
- type HTTPAirdbResponse
- type HTTPClient
- func (client *HTTPClient) DoRequest(request *http.Request, requestInterface RequestInterface, ...) error
- func (client *HTTPClient) Downloader() (io.ReadCloser, error)
- func (client *HTTPClient) GetBody() interface{}
- func (client *HTTPClient) GetDebug() bool
- func (client *HTTPClient) GetDomain() string
- func (client *HTTPClient) GetEndpoint() string
- func (client *HTTPClient) GetHeaders() map[string]string
- func (client *HTTPClient) GetMethod() string
- func (client *HTTPClient) GetTimeout() int
- func (client *HTTPClient) GetURL() string
- func (client *HTTPClient) GetUserAgent() string
- func (client *HTTPClient) GetValues() url.Values
- func (client *HTTPClient) HTTPRequest(requestInterface RequestInterface, responseInterface ResponseInterface) error
- func (client *HTTPClient) HTTPRequestGet(ctx context.Context, requestInterface RequestInterface, ...) error
- func (client *HTTPClient) HTTPRequestPost(ctx context.Context, requestInterface RequestInterface, ...) error
- func (client *HTTPClient) SetBody(body interface{})
- func (client *HTTPClient) SetDebug()
- func (client *HTTPClient) SetDomain(domain string)
- func (client *HTTPClient) SetEndpoint(endpoint string)
- func (client *HTTPClient) SetHeaders(headers map[string]string)
- func (client *HTTPClient) SetMethod(method string)
- func (client *HTTPClient) SetTimeout(timeout int)
- func (client *HTTPClient) SetURL(url string)
- func (client *HTTPClient) SetUserAgent(ua string)
- func (client *HTTPClient) SetValues(values url.Values)
- type RequestInterface
- type ResponseInterface
Constants ¶
View Source
const ( UserAgent = "sailor-agent/1.0.0" UserAgentKey = "User-Agent" SchemeHTTP = "http://" SchemeHTTPS = "https://" )
Variables ¶
View Source
var ChiFaas *chiadapter.ChiFaas
View Source
var GinFaas *ginAdapter.GinFaas
Functions ¶
func HandleVersion ¶
func HandleVersion(w http.ResponseWriter, r *http.Request)
VersionHandler - Returns version information @Summary Version handler. @Description Returns version information, like repo, build, runtime, env @Tags version @Accept json @Produce json @Success 200 {string} response "api response" @Router / [get]
func Handler ¶
func Handler(ctx context.Context, req events.APIGatewayRequest) (events.APIGatewayResponse, error)
Handler serverless faas handler.
func HandlerChi ¶
func HandlerChi(ctx context.Context, req events.APIGatewayRequest) (events.APIGatewayResponse, error)
func RunTencentChi ¶
func RunTencentChi(r *chi.Mux)
func RunTencentChiWithSwagger ¶
func RunTencentChiWithSwagger(r *chi.Mux, project string)
func RunTencentGin ¶
Types ¶
type HTTPAirdbResponse ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient() *HTTPClient
func (*HTTPClient) DoRequest ¶
func (client *HTTPClient) DoRequest( request *http.Request, requestInterface RequestInterface, responseInterface ResponseInterface, ) error
func (*HTTPClient) Downloader ¶
func (client *HTTPClient) Downloader() (io.ReadCloser, error)
func (*HTTPClient) GetBody ¶
func (client *HTTPClient) GetBody() interface{}
func (*HTTPClient) GetDebug ¶
func (client *HTTPClient) GetDebug() bool
func (*HTTPClient) GetDomain ¶
func (client *HTTPClient) GetDomain() string
func (*HTTPClient) GetEndpoint ¶
func (client *HTTPClient) GetEndpoint() string
func (*HTTPClient) GetHeaders ¶
func (client *HTTPClient) GetHeaders() map[string]string
func (*HTTPClient) GetMethod ¶
func (client *HTTPClient) GetMethod() string
func (*HTTPClient) GetTimeout ¶
func (client *HTTPClient) GetTimeout() int
func (*HTTPClient) GetURL ¶
func (client *HTTPClient) GetURL() string
func (*HTTPClient) GetUserAgent ¶
func (client *HTTPClient) GetUserAgent() string
func (*HTTPClient) GetValues ¶
func (client *HTTPClient) GetValues() url.Values
func (*HTTPClient) HTTPRequest ¶
func (client *HTTPClient) HTTPRequest(requestInterface RequestInterface, responseInterface ResponseInterface) error
func (*HTTPClient) HTTPRequestGet ¶
func (client *HTTPClient) HTTPRequestGet( ctx context.Context, requestInterface RequestInterface, responseInterface ResponseInterface, ) error
func (*HTTPClient) HTTPRequestPost ¶
func (client *HTTPClient) HTTPRequestPost( ctx context.Context, requestInterface RequestInterface, responseInterface ResponseInterface, ) error
func (*HTTPClient) SetBody ¶
func (client *HTTPClient) SetBody(body interface{})
func (*HTTPClient) SetDebug ¶
func (client *HTTPClient) SetDebug()
func (*HTTPClient) SetDomain ¶
func (client *HTTPClient) SetDomain(domain string)
func (*HTTPClient) SetEndpoint ¶
func (client *HTTPClient) SetEndpoint(endpoint string)
func (*HTTPClient) SetHeaders ¶
func (client *HTTPClient) SetHeaders(headers map[string]string)
func (*HTTPClient) SetMethod ¶
func (client *HTTPClient) SetMethod(method string)
func (*HTTPClient) SetTimeout ¶
func (client *HTTPClient) SetTimeout(timeout int)
func (*HTTPClient) SetURL ¶
func (client *HTTPClient) SetURL(url string)
func (*HTTPClient) SetUserAgent ¶
func (client *HTTPClient) SetUserAgent(ua string)
func (*HTTPClient) SetValues ¶
func (client *HTTPClient) SetValues(values url.Values)
type RequestInterface ¶
type RequestInterface interface { SetDebug() GetDebug() bool SetDomain(string) GetDomain() string SetEndpoint(string) GetEndpoint() string SetURL(string) GetURL() string SetMethod(string) GetMethod() string SetTimeout(int) GetTimeout() int SetHeaders(headers map[string]string) GetHeaders() map[string]string SetValues(url.Values) GetValues() url.Values SetBody(interface{}) GetBody() interface{} SetUserAgent(string) GetUserAgent() string }
type ResponseInterface ¶
type ResponseInterface interface{}
Click to show internal directories.
Click to hide internal directories.