auth

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Username string

	// TokenUID is needed when uploading files
	TokenUID string

	// R is a imroc/req.Req that allows to perform requests with the proper cookies set.
	R *req.Req
}

Credentials object that holds the necessary information to make a request. It does not save the user password, only a tooken and cookies.

func GetInstance

func GetInstance(creds ...string) *Credentials

GetInstance creates and returns a new Credentials instance. It accepts at most 2 parameters: email and password. If any of them are omitted the program will prompt the user to input them through stdout. Note that you can not omit the email and not the password. It panics when login fails.

type TokenNotFound

type TokenNotFound struct{}

TokenNotFound error returned when the parser can't find the TokenUID, this usually means that the login failed or cookies expired

func (*TokenNotFound) Error

func (*TokenNotFound) Error() string

Jump to

Keyboard shortcuts

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