faas-cli: github.com/openfaas/faas-cli/config Index | Files

package config

import "github.com/openfaas/faas-cli/config"


Package Files



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

func DecodeAuth Uses

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

DecodeAuth decodes the input string from base64 to username and password

func EncodeAuth Uses

func EncodeAuth(username string, password string) string

EncodeAuth encodes the username and password strings to base64

func EnsureFile Uses

func EnsureFile() (string, error)

EnsureFile creates the root dir and config file

func LookupAuthConfig Uses

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

LookupAuthConfig returns the username and password for a given gateway

func RemoveAuthConfig Uses

func RemoveAuthConfig(gateway string) error

RemoveAuthConfig deletes the username and password for a given gateway

func UpdateAuthConfig Uses

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

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

type AuthConfig Uses

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

type ConfigFile Uses

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

ConfigFile for OpenFaaS CLI exclusively.

func New Uses

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

New initializes a config file for the given file path

Package config imports 10 packages (graph) and is imported by 5 packages. Updated 2019-01-06. Refresh now. Tools for package owners.