Documentation
¶
Index ¶
- Constants
- Variables
- type AuthenticationFunc
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) Copy(authFunc AuthenticationFunc) (*Client, error)
- func (c *Client) DialWebSocket(relativeURL string) (*websocket.Conn, error)
- func (c *Client) GetAuthMethod() string
- func (c *Client) GetConnectionURL() string
- func (c *Client) GetHTTPClient() *http.Client
- func (c *Client) GetToken() string
- func (c *Client) GetUserAgent() string
- func (c *Client) IsAuthenticated() bool
- func (c *Client) LoadContents(method, contentURL string, headerValues map[string]string, val any) error
- func (c *Client) Logout()
- func (c *Client) SendRequest(method, requestURL string, opts ...Option) (*http.Response, error)
- type Option
Constants ¶
View Source
const ( AuthMethodJWT = "jwt" AuthMethodAdminKeys = "admin_keys" AuthMethodAccessKey = "access_key" )
Variables ¶
View Source
var ( // ErrEntityNotFound indicates the API entity was not found ErrEntityNotFound = errors.New("entity not found") // ErrOperationTimedOut indicates the request has timed out ErrOperationTimedOut = errors.New("operation timed out") )
Functions ¶
This section is empty.
Types ¶
type AuthenticationFunc ¶
func WithAccessKey ¶
func WithAccessKey(apiKey, clientSecret string) AuthenticationFunc
WithAccessKey - authentication with access keys
func WithAdminKeys ¶
func WithAdminKeys(adminKey, adminSecret string) AuthenticationFunc
WithAdminKeys - authentication with admin keys
func WithJWTToken ¶
func WithJWTToken(jwtToken string) AuthenticationFunc
WithJWTToken - authentication with JWT token
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(source, userAgent string, timeout time.Duration, authFunc AuthenticationFunc) (*Client, error)
NewHTTPClient returns a client with the requested config
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
func (*Client) DialWebSocket ¶
func (*Client) GetAuthMethod ¶
GetAuthMethod - returning authorization method
func (*Client) GetConnectionURL ¶
GetConnectionURL - returning client connection url
func (*Client) GetHTTPClient ¶
GetHTTPClient - returning http client
func (*Client) GetUserAgent ¶
GetUserAgent - returning client user agent
func (*Client) IsAuthenticated ¶
IsAuthenticated - check authentificaion
func (*Client) LoadContents ¶
type Option ¶
type Option func(opts *requestOptions) error
func SkipAuthentication ¶
func SkipAuthentication() Option
func WithHeaders ¶
func WithJSONBody ¶
func WithUnsignedBody ¶
Click to show internal directories.
Click to hide internal directories.