creds

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package creds contains logic for KNE credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Node    map[string]*UserPass
	Vendor  map[tpb.Vendor]*UserPass
	Default *UserPass
}

Credentials contains credential info for nodes in the KNE topology.

func (*Credentials) Lookup

func (c *Credentials) Lookup(node string, vendor tpb.Vendor) *UserPass

Lookup returns the username/password to use for the given node name and vendor. Returns nil if no such combination exists. This method is nil-tolerant.

func (*Credentials) String

func (c *Credentials) String() string

func (*Credentials) UnmarshalYAML

func (c *Credentials) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML allows the Credentials type to be correctly unmarshaled from yaml.

type Flags

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

Flags are a collection of credentials flags.

func DefineFlags

func DefineFlags() *Flags

DefineFlags defines flags for allowing user-specified credentials.

func (*Flags) Parse

func (f *Flags) Parse() (*Credentials, error)

Parse parses the flags into Credentials.

type UserPass

type UserPass struct {
	Username string
	Password string
}

UserPass is a username/password combination.

func (*UserPass) String

func (up *UserPass) String() string

Jump to

Keyboard shortcuts

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