client

package
v0.0.0-...-ff244ab Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongPassphrase = errors.New("Unauthorized: wrong passphrase")

ErrWrongPassphrase is used when the passphrase is wrong

Functions

This section is empty.

Types

type Client

type Client struct {
	Addr   string
	Domain string
	Scheme string
	Client *http.Client

	AuthClient  *auth.Client
	AuthScopes  []string
	AuthAccept  auth.UserAcceptFunc
	AuthStorage auth.Storage
	Authorizer  request.Authorizer

	UserAgent string
	Retries   int
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

Client encapsulates the element representing a typical connection to the HTTP api of the cozy-stack.

It holds the elements to authenticate a user, as well as the transport layer used for all the calls to the stack.

func (*Client) Authenticate

func (c *Client) Authenticate() (request.Authorizer, error)

Authenticate is used to authenticate a client via OAuth.

func (*Client) Req

func (c *Client) Req(opts *request.Options) (*http.Response, error)

Req is used to perform a request to the stack given the ReqOptions passed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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