config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOAuthAuthURL

func GetOAuthAuthURL(appURL string) string

func GetOAuthTokenURL

func GetOAuthTokenURL(appURL string) string

func Save

func Save(cfg *Config) error

Types

type AuthConfig

type AuthConfig struct {
	ActiveProfile ProfileName                   `json:"active_profile"`
	Profiles      map[ProfileName]SessionConfig `json:"profiles"`
}

type Config

type Config struct {
	Auth AuthConfig `json:"auth"`
}

func Get

func Get() (*Config, error)

type ProfileName

type ProfileName string

type SessionConfig

type SessionConfig struct {
	ClientID  string       `json:"client_id"`
	ApiURL    string       `json:"api_url"`
	AppURL    string       `json:"app_url"`
	AccountID string       `json:"account_id"`
	UserID    string       `json:"user_id"`
	Token     oauth2.Token `json:"token"`
	CreatedAt time.Time    `json:"created_at"`
}

func (SessionConfig) GetOAuth2Config

func (c SessionConfig) GetOAuth2Config() oauth2.Config

Jump to

Keyboard shortcuts

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