Documentation ¶
Index ¶
- Constants
- Variables
- func AddMissingSlashToURL(baseUrl *string)
- func AllPlugins() map[string]Plugin
- func ConvertStringToTime(timeString string) (t time.Time, err error)
- func DecodeMapStruct(input map[string]interface{}, result interface{}) error
- func FindPluginNameBySubPkgPath(subPkgPath string) (string, error)
- func GetRateLimitPerSecond(options map[string]interface{}, defaultValue int) (int, error)
- func GetURIStringPointer(baseUrl string, relativePath string, queryParams *url.Values) (*string, error)
- func Iso8601TimeToTime(iso8601Time *Iso8601Time) *time.Time
- func RegisterPlugin(name string, plugin Plugin) error
- func RemoveStartingSlashFromPath(relativePath string) string
- 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) GetEndpoint() string
- func (apiClient *ApiClient) GetHeaders() map[string]string
- func (apiClient *ApiClient) SetAfterFunction(callback ApiClientAfterResponse)
- func (apiClient *ApiClient) SetBeforeFunction(callback ApiClientBeforeRequest)
- func (apiClient *ApiClient) SetContext(ctx context.Context)
- 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 DateTimeFormatItem
- type Iso8601Time
- type Plugin
- type TestResult
Constants ¶
View Source
const DNSResolveFailedError = "Failed to find ip address"
View Source
const InvalidConnectionError = "Your connection configuration is invalid."
View Source
const InvalidEndpointError = "Failed to parse endpoint"
View Source
const InvalidParams = "Failed to decode request params"
View Source
const InvalidSchema = "Failed to find port for schema"
View Source
const NetworkConnectError = "Failed to connect to endpoint"
View Source
const SchemaIsRequired = "Endpoint schema is required"
View Source
const SourceIdError = "Missing or Invalid sourceId"
View Source
const UnmarshallingError = "There was a problem unmarshalling the response"
View Source
const UnsetConnectionError = "Your connection configuration is not set."
Variables ¶
View Source
var DateTimeFormats []DateTimeFormatItem
View Source
var TaskCanceled = fmt.Errorf("task got canceled")
Functions ¶
func AddMissingSlashToURL ¶ added in v0.6.0
func AddMissingSlashToURL(baseUrl *string)
func AllPlugins ¶
func ConvertStringToTime ¶ added in v0.4.0
func DecodeMapStruct ¶ added in v0.6.0
mapstructure.Decode with time.Time and Iso8601Time support
func GetRateLimitPerSecond ¶ added in v0.7.0
func GetURIStringPointer ¶ added in v0.6.0
func Iso8601TimeToTime ¶ added in v0.6.0
func Iso8601TimeToTime(iso8601Time *Iso8601Time) *time.Time
func RegisterPlugin ¶
func RemoveStartingSlashFromPath ¶ added in v0.6.0
func UnmarshalResponse ¶
Types ¶
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
func NewApiClient ¶
func (*ApiClient) GetEndpoint ¶ added in v0.6.0
func (*ApiClient) GetHeaders ¶ added in v0.6.0
func (*ApiClient) SetAfterFunction ¶ added in v0.6.0
func (apiClient *ApiClient) SetAfterFunction(callback ApiClientAfterResponse)
func (*ApiClient) SetBeforeFunction ¶ added in v0.4.0
func (apiClient *ApiClient) SetBeforeFunction(callback ApiClientBeforeRequest)
func (*ApiClient) SetContext ¶ added in v0.6.0
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 Status int }
type DateTimeFormatItem ¶ added in v0.4.0
type Iso8601Time ¶
type Iso8601Time struct {
// contains filtered or unexported fields
}
type Iso8601Time time.Time
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
type Plugin ¶
type TestResult ¶ added in v0.6.0
func ValidateParams ¶ added in v0.6.0
func ValidateParams(input *ApiResourceInput, requiredParams []string) *TestResult
func (*TestResult) Set ¶ added in v0.6.0
func (testResult *TestResult) Set(success bool, message string)
Click to show internal directories.
Click to hide internal directories.