Documentation ¶
Overview ¶
Package dotrill implements setting and getting key-value pairs in YAML files in ~/.rill.
Index ¶
- Constants
- func AnalyticsInfo() (installID string, enabled bool, err error)
- func Get(filename, key string) (string, error)
- func GetAccessToken() (string, error)
- func GetAll(filename string) (map[string]string, error)
- func GetBackupToken() (string, error)
- func GetDefaultAdminURL() (string, error)
- func GetDefaultOrg() (string, error)
- func GetEnvToken(env string) (string, error)
- func GetRepresentingUser() (string, error)
- func GetVersion() (string, error)
- func GetVersionUpdatedAt() (string, error)
- func ResolveFilename(name string, mkdir bool) (string, error)
- func Set(filename, key, value string) error
- func SetAccessToken(token string) error
- func SetBackupToken(token string) error
- func SetDefaultAdminURL(url string) error
- func SetDefaultOrg(orgName string) error
- func SetEnvToken(env, token string) error
- func SetRepresentingUser(email string) error
- func SetVersion(version string) error
- func SetVersionUpdatedAt(updatedAt string) error
Constants ¶
const ( ConfigFilename = "config.yaml" // For user-facing config CredentialsFilename = "credentials.yaml" // For access tokens StateFilename = "state.yaml" // For CLI state )
Constants for YAML files
const ( DefaultOrgConfigKey = "org" DefaultAdminURLConfigKey = "api_url" AnalyticsEnabledConfigKey = "analytics_enabled" AccessTokenCredentialsKey = "token" InstallIDStateKey = "install_id" RepresentingUserCredentialsKey = "representing_user" BackupTokenCredentialsKey = "backup_token" VersionKey = "latest_version" VersionUpdatedAtKey = "latest_version_checked_at" )
Constants for YAML keys
Variables ¶
This section is empty.
Functions ¶
func AnalyticsInfo ¶
AnalyticsInfo returns analytics info. It loads a persistent install ID from ~/.rill/state.yaml (setting one if not found). It gets analytics enabled/disabled info from ~/.rill/config.yaml (key "analytics_enabled"). It automatically migrates from the pre-v0.23 analytics config. See migrateOldAnalyticsConfig for details.
func Get ¶
Get returns a single entry from ~/.rill/{filename}. It assumes filename identifies a YAML file.
func GetAll ¶
GetAll loads all values from ~/.rill/{filename}. It assumes filename identifies a YAML file.
func GetBackupToken ¶ added in v0.27.0
GetBackupToken loads the original auth token
func GetDefaultAdminURL ¶ added in v0.24.0
GetDefaultAdminURL loads the default admin URL (if set)
func GetEnvToken ¶ added in v0.28.2
GetEnvToken loads the token for given env
func GetRepresentingUser ¶ added in v0.27.0
GetRepresentingUser loads the current representing user email
func GetVersion ¶ added in v0.24.1
func GetVersionUpdatedAt ¶ added in v0.24.1
func ResolveFilename ¶ added in v0.26.0
ResolveFilename resolves a file name to a full path to ~/.rill. If mkdir is true, it will create the .rill directory if it doesn't exist.
func Set ¶
Set sets a single value in ~/.rill/{filename}. It assumes filename identifies a YAML file.
func SetBackupToken ¶ added in v0.27.0
SetBackupToken saves original auth token
func SetDefaultAdminURL ¶ added in v0.26.0
SetDefaultAdminURL loads the default admin URL (if set)
func SetEnvToken ¶ added in v0.28.2
SetEnvToken backup the token for given env
func SetRepresentingUser ¶ added in v0.27.0
SetRepresentingUser saves representing user email
func SetVersion ¶ added in v0.24.1
func SetVersionUpdatedAt ¶ added in v0.24.1
Types ¶
This section is empty.