Documentation ¶
Index ¶
- Constants
- func ConfigFile() string
- func ConfigLockFile() string
- func CurrentConfigFilePath() string
- func LoadConfig() error
- func ManifestFilepath(kind string, target string) (string, error)
- func ReadManifest(kind string, target string) (*bundle.Manifest, error)
- func SaveConfig() error
- func SaveManifest(kind string, target string, manifest bundle.Manifest) error
- func SetConfigFile(filepath string)
- func SetDefaultDir() error
- func SetDir(p string)
- func SetVersionCheckTime()
- func VersionCheckTime() *time.Time
- type ConfigRoot
- type ConfigRootV2
- type CurrentContext
- type User
- type UserV2
Constants ¶
const DefaultDirName = ".cas"
DefaultDirName is the name of the store working directory.
const DirPerm os.FileMode = 0700
DirPerm holds permission bits that are used for all directories that store creates.
const FilePerm os.FileMode = 0600
FilePerm holds permission bits that are used for all files that store creates.
Variables ¶
This section is empty.
Functions ¶
func ConfigLockFile ¶ added in v1.0.3
func ConfigLockFile() string
ConfigLockFile returns the config lock file path (e.g. ~/.cas/config.lock)
func CurrentConfigFilePath ¶
func CurrentConfigFilePath() string
CurrentConfigFilePath returns the current config file path
func SetDefaultDir ¶
func SetDefaultDir() error
SetDefaultDir sets the default store working directory
func SetVersionCheckTime ¶
func SetVersionCheckTime()
SetVersionCheckTime set the latest version check to now.
func VersionCheckTime ¶
VersionCheckTime returns the time of latest version check, if any.
Types ¶
type ConfigRoot ¶
type ConfigRoot struct { SchemaVersion uint `json:"schemaVersion"` Users []*User `json:"users"` CurrentContext CurrentContext `json:"currentContext"` }
ConfigRoot holds root fields of the configuration file.
func (*ConfigRoot) ClearContext ¶
func (c *ConfigRoot) ClearContext()
ClearContext clean up all auth token for all users and set an empty context.
func (*ConfigRoot) NewLcUser ¶
func (c *ConfigRoot) NewLcUser(host, port, lcCert string, lcSkipTlsVerify, lcNoTls bool) (u *CurrentContext)
User returns an User from the global config matching the given email. User returns nil when an empty email is given or c is nil.
type ConfigRootV2 ¶
type ConfigRootV2 struct { SchemaVersion uint `json:"schemaVersion"` Users []*UserV2 `json:"users"` CurrentContext string `json:"currentContext"` }
ConfigRoot holds root fields of the configuration file.
type CurrentContext ¶
type CurrentContext struct { LcHost string `json:"LcHost,omitempty"` LcPort string `json:"LcPort,omitempty"` LcCert string `json:"LcCert,omitempty"` LcSkipTlsVerify bool `json:"LcSkipTlsVerify,omitempty"` LcNoTls bool `json:"LcNoTls,omitempty"` }
func (*CurrentContext) Clear ¶
func (cc *CurrentContext) Clear()