client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client holds the connection to the OpenSlides server.

func New

func New(cfg config.Config) (*Client, error)

New initializes a new client.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do is like http.Do but uses the credentials.

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

Login uses the username and password to login the client. Sets the returned cookie for later requests.

func (*Client) LoginWithCredentials

func (c *Client) LoginWithCredentials(ctx context.Context, username, password string) error

LoginWithCredentials is like Login but uses the given credentials instead of config.

func (*Client) UserID

func (c *Client) UserID() int

UserID returns the userID of the client.

Jump to

Keyboard shortcuts

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