config

package
v0.0.0-...-70ebebb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDir  = "~/.openfaas"
	DefaultFile = "config.yml"
)

Functions

func DecodeAuth

func DecodeAuth(input string) (string, string, error)

DecodeAuth decodes the input string from base64 to username and password

func EncodeAuth

func EncodeAuth(username string, password string) string

EncodeAuth encodes the username and password strings to base64

func EnsureFile

func EnsureFile() (string, error)

EnsureFile creates the root dir and config file

func LookupAuthConfig

func LookupAuthConfig(gateway string) (string, string, error)

LookupAuthConfig returns the username and password for a given gateway

func RemoveAuthConfig

func RemoveAuthConfig(gateway string) error

RemoveAuthConfig deletes the username and password for a given gateway

func UpdateAuthConfig

func UpdateAuthConfig(gateway string, username string, password string) error

UpdateAuthConfig creates or updates the username and password for a given gateway

Types

type AuthConfig

type AuthConfig struct {
	Gateway string `yaml:"gateway,omitempty"`
	Auth    string `yaml:"auth,omitempty"`
	Token   string `yaml:"token,omitempty"`
}

type ConfigFile

type ConfigFile struct {
	AuthConfigs []AuthConfig `yaml:"auths"`
	FilePath    string       `yaml:"-"`
}

ConfigFile for OpenFaaS CLI exclusively.

func New

func New(filePath string) (*ConfigFile, error)

New initializes a config file for the given file path

Jump to

Keyboard shortcuts

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