credentials

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 4 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package credentials describes credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogin

func GetLogin() string

Types

type Credentials

type Credentials interface {
	GetUsername() (string, error)
	GetPasswords() []Secret
	GetPrivateKey() []byte
	GetPassphrase() Secret
	AgentEnabled() bool
}

type CredentialsOption

type CredentialsOption func(*SimpleCredentials)

func WithLogger

func WithLogger(logger *zap.Logger) CredentialsOption

func WithPassphrase

func WithPassphrase(passphrase Secret) CredentialsOption

func WithPassword

func WithPassword(password Secret) CredentialsOption

func WithPasswords

func WithPasswords(password []Secret) CredentialsOption

func WithPrivateKey

func WithPrivateKey(key []byte) CredentialsOption

func WithSSHAgent

func WithSSHAgent() CredentialsOption

func WithUsername

func WithUsername(username string) CredentialsOption

type Secret

type Secret string

func (Secret) MarshalText

func (Secret) MarshalText() ([]byte, error)

func (Secret) String

func (Secret) String() string

func (Secret) Value

func (m Secret) Value() string

type SimpleCredentials

type SimpleCredentials struct {
	// contains filtered or unexported fields
}

func NewSimpleCredentials

func NewSimpleCredentials(opts ...CredentialsOption) *SimpleCredentials

func (SimpleCredentials) AgentEnabled

func (m SimpleCredentials) AgentEnabled() bool

func (SimpleCredentials) GetPassphrase

func (m SimpleCredentials) GetPassphrase() Secret

func (SimpleCredentials) GetPasswords

func (m SimpleCredentials) GetPasswords() []Secret

func (SimpleCredentials) GetPrivateKey

func (m SimpleCredentials) GetPrivateKey() []byte

func (SimpleCredentials) GetUsername

func (m SimpleCredentials) GetUsername() (string, error)

Jump to

Keyboard shortcuts

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