client

package
v0.0.0-...-e8cbe11 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorResponse

func NewErrorResponse(resp *http.Response) error

func WithAuthCheck

func WithAuthCheck() func(c *Client) error

func WithHTTPClient

func WithHTTPClient(httpClient HTTPClient) func(c *Client) error

func WithHTTPRequester

func WithHTTPRequester(httpRequester HTTPRequester) func(c *Client) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string, opts ...func(client *Client) error) (client *Client, err error)

func (Client) AuthCheck

func (c Client) AuthCheck() (err error)

func (Client) GetAllowedExtensions

func (c Client) GetAllowedExtensions() []string

func (Client) GetPage

func (c Client) GetPage(pageNumber, perPage int) (page Page, err error)

type ErrorResponse

type ErrorResponse struct {
	// contains filtered or unexported fields
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type HTTPRequester

type HTTPRequester interface {
	NewRequest(method, url string, body io.Reader) (*http.Request, error)
}

type HTTPWrapper

type HTTPWrapper struct{}

func NewHTTPWrapper

func NewHTTPWrapper() HTTPWrapper

func (HTTPWrapper) NewRequest

func (h HTTPWrapper) NewRequest(method, url string, body io.Reader) (*http.Request, error)

type Media

type Media struct {
	// contains filtered or unexported fields
}

func NewMedia

func NewMedia(fileName string, fileSize int64) Media

func (Media) FileName

func (m Media) FileName() string

func (Media) FileSize

func (m Media) FileSize() int64

type Page

type Page struct {
	// contains filtered or unexported fields
}

func NewPage

func NewPage(totalPages int, medias []Media) Page

func (Page) Medias

func (p Page) Medias() []Media

func (Page) TotalPages

func (p Page) TotalPages() int

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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