client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyAuth added in v1.2.0

type ApiKeyAuth struct {
	ApiKey string
}

func (*ApiKeyAuth) Auth added in v1.2.0

func (a *ApiKeyAuth) Auth(req *http.Request) error

type ArrTransport added in v1.2.0

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

ArrTransport is a http.RoundTripper that adds authentication to requests

func NewArrTransport added in v1.2.0

func NewArrTransport(auth Authenticator, inner http.RoundTripper) *ArrTransport

func (*ArrTransport) RoundTrip added in v1.2.0

func (t *ArrTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Authenticator added in v1.2.0

type Authenticator interface {
	Auth(req *http.Request) error
}

type BasicAuth added in v1.2.0

type BasicAuth struct {
	Username string
	Password string
	ApiKey   string
}

func (*BasicAuth) Auth added in v1.2.0

func (a *BasicAuth) Auth(req *http.Request) error

type Client

type Client struct {
	URL url.URL
	// contains filtered or unexported fields
}

Client struct is an *Arr client.

func NewClient

func NewClient(config *config.Config) (*Client, error)

NewClient method initializes a new *Arr client.

func (*Client) DoRequest

func (c *Client) DoRequest(endpoint string, target interface{}, queryParams ...map[string]string) error

DoRequest - Take a HTTP Request and return Unmarshaled data

type FormAuth added in v1.2.0

type FormAuth struct {
	Username    string
	Password    string
	ApiKey      string
	AuthBaseURL *url.URL
	Transport   http.RoundTripper
	// contains filtered or unexported fields
}

func (*FormAuth) Auth added in v1.2.0

func (a *FormAuth) Auth(req *http.Request) error

Jump to

Keyboard shortcuts

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