Documentation
¶
Index ¶
- Variables
- func DeviceFlowLogin(ctx context.Context, clientID string, scopes []string) (string, error)
- func GetToken(provider Provider) (string, error)
- func IsKeyringAvailable() bool
- func IsLoggedIn(provider Provider) bool
- func Login(provider Provider, token string) error
- func LoginWithOAuth(ctx context.Context, provider Provider, clientID string, scopes []string) (string, error)
- func Logout(provider Provider) error
- func Reset()
- func SetSecureStoreForTest(s *SecureStore)
- func ValidateToken(ctx context.Context, provider Provider) (string, error)
- type Credentials
- type Provider
- type SecureStore
- type StoredCredentials
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotAuthenticated = errors.New("not authenticated") ErrInvalidToken = errors.New("invalid token") )
View Source
var (
)
Functions ¶
func DeviceFlowLogin ¶
func IsKeyringAvailable ¶
func IsKeyringAvailable() bool
func IsLoggedIn ¶
func LoginWithOAuth ¶
func SetSecureStoreForTest ¶
func SetSecureStoreForTest(s *SecureStore)
Types ¶
type Credentials ¶
type Provider ¶
type Provider string
const (
ProviderGitHub Provider = "github"
)
func ParseProvider ¶
type SecureStore ¶
type SecureStore struct {
ServiceName string
// contains filtered or unexported fields
}
func NewSecureStore ¶
func NewSecureStore(service string) *SecureStore
func (*SecureStore) Delete ¶
func (s *SecureStore) Delete(provider Provider) error
func (*SecureStore) SetFallbackDir ¶
func (s *SecureStore) SetFallbackDir(dir string)
func (*SecureStore) SetForceFallback ¶
func (s *SecureStore) SetForceFallback(force bool)
type StoredCredentials ¶
type StoredCredentials struct {
Credentials map[Provider]Credentials
}
Click to show internal directories.
Click to hide internal directories.