client

package
v0.0.0-...-5df0669 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextSlug

func NextSlug() string

func ProcessResponse

func ProcessResponse(ar oauth2.AuthorizationResponse) error

func Save

func Save(client Client) error

Types

type Client

type Client struct {
	Slug         string
	ServerSlug   string    `yaml:"server_slug"`
	CreatedAt    time.Time `yaml:"created_at"`
	Id           string
	SecretHandle string   `yaml:"secret_handle"`
	RedirectURIs []string `yaml:"redirect_uris"`
}

func FindById

func FindById(clientId string) (Client, bool)

func FindBySlug

func FindBySlug(slug string) (Client, bool)

func (Client) ExchangeCode

func (c Client) ExchangeCode(code, redirectUri, codeVerifier string) (oauth2.AccessTokenResponse, error)

func (Client) GetClientId

func (c Client) GetClientId() string

func (Client) GetRedirectUris

func (c Client) GetRedirectUris() []string

func (Client) GetSecret

func (c Client) GetSecret() (string, error)

func (Client) GetServer

func (c Client) GetServer() (server.Server, error)

func (Client) SetSecret

func (c Client) SetSecret(secret string) error

type Clients

type Clients []Client

func Load

func Load() Clients

func LoadForServer

func LoadForServer(serverSlug string) Clients

func (Clients) FindById

func (clients Clients) FindById(clientId string) (Client, bool)

func (Clients) FindBySlug

func (clients Clients) FindBySlug(slug string) (Client, bool)

func (Clients) NextSlug

func (clients Clients) NextSlug() string

Jump to

Keyboard shortcuts

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