auth

package
v0.0.0-...-95f6ed8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIGithubCom = "api.github.com"
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() string

func HostsFile

func HostsFile() string

Types

type Config

type Config interface {
	GetToken(hostname string) string
	GetUser(hostname string) string
	HasHosts() bool
	GetHosts() []string
}

Config interface describes interacting with some persistent configuration for gh.

func NewDefaultConfig

func NewDefaultConfig() (Config, error)

func ParseDefaultConfig

func ParseDefaultConfig(cf, hf string) (Config, error)

type FakeConfig

type FakeConfig struct {
	Hosts map[string]*HostConfig
}

func (*FakeConfig) GetHosts

func (f *FakeConfig) GetHosts() []string

func (*FakeConfig) GetToken

func (f *FakeConfig) GetToken(hostname string) string

func (*FakeConfig) GetUser

func (f *FakeConfig) GetUser(hostname string) string

func (*FakeConfig) HasHosts

func (f *FakeConfig) HasHosts() bool

type HostConfig

type HostConfig struct {
	User  string `yaml:"user"`
	Token string `yaml:"oauth_token"`
}

HostConfig a struct containing the host level information.

Jump to

Keyboard shortcuts

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