Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRestyClient ¶
func NewRestyClient(cfg Config) *resty.Client
Types ¶
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
func NewAuthentication ¶
func NewAuthentication(cfg Config) *Authentication
func (*Authentication) OAuth2 ¶
func (a *Authentication) OAuth2(ctx context.Context) (*entity.OAuth2Resp, error)
type Config ¶
type Config struct { ClientID string ClientSecret string // Timeout describes total waiting time before a request is treated as timeout. // Optional. // Default: 1 min. Timeout time.Duration // RetryCount describes total number of retry in case error occurred. // Optional. // Default: 0 = disable retry mechanism. RetryCount int // RetryMaxWaitTime describes total waiting time between each retry. // Optional. // Default: 2 second. RetryMaxWaitTime time.Duration // Debug describes the client to enter debug mode. // Debug mode will dump the request and response on each API call. // Be warn, credentials data will be dumped too. // Ensure you're only this mode on safe environment like local. // Optional. // Default: false. Debug bool // HostURL describes the host url target. // HostURL can be filled with your fake server host url for testing purpose. // Optional. // Default: https://api-sandbox.btpn.com:8089 HostURL string }
Config is the necessary configuration to call API.
Click to show internal directories.
Click to hide internal directories.