shared

package
v2.0.0-...-98537dd Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthTokenWriteable

func AuthTokenWriteable(cfg config.Config, hostname string) (string, bool)

func GetScopes

func GetScopes(httpClient httpClient, hostname, authToken string) (string, error)

func HasMinimumScopes

func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error

func Login

func Login(opts *LoginOptions) error

Types

type GitCredentialFlow

type GitCredentialFlow struct {
	Executable string
	Prompter   Prompt
	GitClient  *git.Client
	// contains filtered or unexported fields
}

func (*GitCredentialFlow) Prompt

func (flow *GitCredentialFlow) Prompt(hostname string) error

func (*GitCredentialFlow) Scopes

func (flow *GitCredentialFlow) Scopes() []string

func (*GitCredentialFlow) Setup

func (flow *GitCredentialFlow) Setup(hostname, username, authToken string) error

func (*GitCredentialFlow) ShouldSetup

func (flow *GitCredentialFlow) ShouldSetup() bool

type LoginOptions

type LoginOptions struct {
	IO          *iostreams.IOStreams
	Config      iconfig
	HTTPClient  *http.Client
	GitClient   *git.Client
	Hostname    string
	Interactive bool
	Web         bool
	Scopes      []string
	Executable  string
	GitProtocol string
	Prompter    Prompt
	// contains filtered or unexported fields
}

type MissingScopesError

type MissingScopesError struct {
	MissingScopes []string
}

func (MissingScopesError) Error

func (e MissingScopesError) Error() string

type Prompt

type Prompt interface {
	Select(string, string, []string) (int, error)
	Confirm(string, bool) (bool, error)
	InputHostname() (string, error)
	AuthToken() (string, error)
	Input(string, string) (string, error)
	Password(string) (string, error)
}

Jump to

Keyboard shortcuts

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