oauth2

package
v0.0.0-...-80f5753 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CallbackPage = "" /* 768-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	AuthUrl  string
	Username string
	Client   *http.Client
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(authUrl string) *API

func (*API) AuthFromFile

func (i *API) AuthFromFile(tokenFile string) (token TokenWithUsername, err error)

func (*API) AuthFromWeb

func (i *API) AuthFromWeb() (*oauth2.Token, error)

func (*API) Authorise

func (i *API) Authorise(tokenFile string) error

func (*API) SaveAuth

func (i *API) SaveAuth(tokenFile string, token TokenWithUsername) error

func (*API) SetConfig

func (i *API) SetConfig(config *oauth2.Config)

type TokenWithUsername

type TokenWithUsername struct {
	Token    *oauth2.Token `json:"token"`
	Username string        `json:"username,omitempty"`
}

Jump to

Keyboard shortcuts

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