Documentation ¶
Index ¶
- Constants
- func AllPlugins() map[string]Plugin
- func FindPluginNameBySubPkgPath(subPkgPath string) (string, error)
- func RegisterPlugin(name string, plugin Plugin) error
- func UnmarshalResponse(res *http.Response, v interface{}) error
- type ApiClient
- func (apiClient *ApiClient) Do(method string, path string, query *url.Values, body *map[string]interface{}, ...) (*http.Response, error)
- func (apiClient *ApiClient) Get(path string, query *url.Values, headers *map[string]string) (*http.Response, error)
- func (apiClient *ApiClient) SetEndpoint(endpoint string)
- func (apiClient *ApiClient) SetHeaders(headers map[string]string)
- func (ApiClient *ApiClient) SetMaxRetry(maxRetry int)
- func (apiClient *ApiClient) SetProxy(proxyUrl string) error
- func (ApiClient *ApiClient) SetTimeout(timeout time.Duration)
- func (apiClient *ApiClient) Setup(endpoint string, headers map[string]string, timeout time.Duration, ...)
- type ApiClientAfterResponse
- type ApiClientBeforeRequest
- type ApiResourceHandler
- type ApiResourceInput
- type ApiResourceOutput
- type Iso8601Time
- type Plugin
Constants ¶
View Source
const ISO_8601_FORMAT = "2006-01-02T15:04:05-0700"
Variables ¶
This section is empty.
Functions ¶
func AllPlugins ¶
func RegisterPlugin ¶
func UnmarshalResponse ¶
Types ¶
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
func NewApiClient ¶
func (*ApiClient) SetEndpoint ¶
func (*ApiClient) SetHeaders ¶
func (*ApiClient) SetMaxRetry ¶
func (*ApiClient) SetTimeout ¶
type ApiClientAfterResponse ¶
type ApiClientBeforeRequest ¶
type ApiResourceHandler ¶ added in v0.3.0
type ApiResourceHandler func(input *ApiResourceInput) (*ApiResourceOutput, error)
type ApiResourceInput ¶ added in v0.3.0
type ApiResourceOutput ¶ added in v0.3.0
type ApiResourceOutput struct {
Body interface{} // response body
}
type Iso8601Time ¶
parse iso8601 datetime format for json.Unmarshal
declare your field type as:
type Foo struct { Created Iso8601Time }
foo := &Foo{} err := json.Unmarshal("{\"created\": \"2021-02-19T01:53:35.340+0800\"}", foo) var time time.Time time = foo.Created.ToTime()
func (Iso8601Time) MarshalJSON ¶
func (jt Iso8601Time) MarshalJSON() ([]byte, error)
func (*Iso8601Time) String ¶
func (jt *Iso8601Time) String() string
func (*Iso8601Time) ToTime ¶
func (jt *Iso8601Time) ToTime() time.Time
func (*Iso8601Time) UnmarshalJSON ¶
func (jt *Iso8601Time) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.