Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeAuth(input string) (string, string, error)
- func EncodeAuth(username string, password string) string
- func EnsureFile() (string, error)
- func RemoveAuthConfig(gateway string) error
- func UpdateAuthConfig(gateway, token string, authType AuthType) error
- type AuthConfig
- type AuthType
- type ConfigFile
Constants ¶
View Source
const ( //BasicAuthType basic authentication type BasicAuthType = "basic" //Oauth2AuthType oauth2 authentication type Oauth2AuthType = "oauth2" )
Variables ¶
View Source
var ( DefaultDir = "~/.openfaas" DefaultFile = "config.yml" )
Functions ¶
func DecodeAuth ¶
DecodeAuth decodes the input string from base64 to username and password
func EncodeAuth ¶
EncodeAuth encodes the username and password strings to base64
func RemoveAuthConfig ¶
RemoveAuthConfig deletes the username and password for a given gateway
func UpdateAuthConfig ¶
UpdateAuthConfig creates or updates the username and password for a given gateway
Types ¶
type AuthConfig ¶
type AuthConfig struct { Gateway string `yaml:"gateway,omitempty"` Auth AuthType `yaml:"auth,omitempty"` Token string `yaml:"token,omitempty"` }
func LookupAuthConfig ¶
func LookupAuthConfig(gateway string) (AuthConfig, error)
LookupAuthConfig returns the username and password for a given gateway
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
Click to show internal directories.
Click to hide internal directories.