common

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication interface {
	SetBasicAuth(mail, token string)
	GetBasicAuth() (string, string)
	HasBasicAuth() bool

	SetUserAgent(agent string)
	GetUserAgent() string
	HasUserAgent() bool

	SetExperimentalFlag()
	HasSetExperimentalFlag() bool

	SetBearerToken(token string)
	GetBearerToken() string
}

type Client

type Client interface {
	NewJsonRequest(ctx context.Context, method, apiEndpoint string, payload io.Reader) (*http.Request, error)
	NewRequest(ctx context.Context, method, apiEndpoint string, payload io.Reader) (*http.Request, error)
	NewFormRequest(ctx context.Context, method, apiEndpoint, formDataContentType string, payload io.Reader) (*http.Request, error)
	Call(request *http.Request, structure interface{}) (*models.ResponseScheme, error)
	TransformTheHTTPResponse(response *http.Response, structure interface{}) (*models.ResponseScheme, error)
	TransformStructToReader(structure interface{}) (io.Reader, error)
}

type HttpClient

type HttpClient interface {
	Do(request *http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL