credentials

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Generic []*Generic `json:"generic,omitempty" xml:"generic,omitempty" yaml:"generic,omitempty"`
}

Config represents a collection of various credentials.

func (*Config) Add

func (cfg *Config) Add(c Credential) error

Add adds a credential to Config.

func (*Config) ExtractGeneric

func (cfg *Config) ExtractGeneric(s string) *Generic

ExtractGeneric returns Generic credentials by name.

func (*Config) FindCredential

func (cfg *Config) FindCredential(s string) bool

FindCredential search for Credential by name.

type Credential

type Credential interface {
	Validate() error
}

Credential is an interface to work with credentials.

type Generic

type Generic struct {
	Name     string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
	Username string `json:"username,omitempty" xml:"username,omitempty" yaml:"username,omitempty"`
	Password string `json:"password,omitempty" xml:"password,omitempty" yaml:"password,omitempty"`
	Domain   string `json:"domain,omitempty" xml:"domain,omitempty" yaml:"domain,omitempty"`
}

Generic represents username and password credentials, with optional domain name field.

func (*Generic) Validate

func (c *Generic) Validate() error

Validate validates Generic credentials.

Jump to

Keyboard shortcuts

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