Documentation ¶
Index ¶
- Constants
- type Client
- type DefaultClient
- func (c *DefaultClient) GetConfig() *config.Config
- func (c *DefaultClient) GetHTTPClient() *http.Client
- func (c *DefaultClient) NewRequest(ctx context.Context, method string, path string, queryParams map[string]string, ...) error
- func (c *DefaultClient) RawRequest(ctx context.Context, method string, path string, queryParams map[string]string, ...) ([]byte, error)
Constants ¶
View Source
const ( EnvTest = config.EnvTest EnvLive = config.EnvLive )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NewRequest(ctx context.Context, method string, path string, queryParams map[string]string, body []byte, v interface{}, headers map[string][]string) error RawRequest(ctx context.Context, method string, path string, queryParams map[string]string, body []byte, headers map[string][]string) ([]byte, error) GetConfig() *config.Config GetHTTPClient() *http.Client }
type DefaultClient ¶
func New ¶
func New(projectID string, secret string) *DefaultClient
func (*DefaultClient) GetConfig ¶
func (c *DefaultClient) GetConfig() *config.Config
func (*DefaultClient) GetHTTPClient ¶
func (c *DefaultClient) GetHTTPClient() *http.Client
func (*DefaultClient) NewRequest ¶
func (c *DefaultClient) NewRequest( ctx context.Context, method string, path string, queryParams map[string]string, body []byte, v interface{}, headers map[string][]string, ) error
newRequest is used by Call to generate and Do a http.Request
func (*DefaultClient) RawRequest ¶
func (c *DefaultClient) RawRequest( ctx context.Context, method string, path string, queryParams map[string]string, body []byte, headers map[string][]string, ) ([]byte, error)
RawRequest sends the request and returns the successful response body as bytes. If the response is an error, the response body will be parsed and returned as (nil, stytcherror.Error).
Prefer using NewRequest (which unmarshals the response JSON) unless you need the actual bytes.
Click to show internal directories.
Click to hide internal directories.