Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteLogin ¶
DeleteLogin delete a login by name from config
func SetDefaultLogin ¶
SetDefaultLogin set the default login by name (case insensitive)
func UpdateLogin ¶ added in v0.10.0
UpdateLogin updates an existing login in the config
Types ¶
type FlagDefaults ¶ added in v0.9.0
type FlagDefaults struct {
// Prefer a specific git remote to use for selecting a repository on gitea,
// instead of relying on the remote associated with main/master/trunk branch.
// The --remote flag still has precedence over this value.
Remote string `yaml:"remote"`
}
FlagDefaults defines all flags that can be overridden with a default value via the config file
type LocalConfig ¶
type LocalConfig struct {
Logins []Login `yaml:"logins"`
Prefs Preferences `yaml:"preferences"`
}
LocalConfig represents local configurations
type Login ¶
type Login struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
Token string `yaml:"token"`
Default bool `yaml:"default"`
SSHHost string `yaml:"ssh_host"`
// optional path to the private key
SSHKey string `yaml:"ssh_key"`
Insecure bool `yaml:"insecure"`
SSHCertPrincipal string `yaml:"ssh_certificate_principal"`
SSHAgent bool `yaml:"ssh_agent"`
SSHKeyFingerprint string `yaml:"ssh_key_agent_pub"`
SSHPassphrase string `yaml:"-"`
VersionCheck bool `yaml:"version_check"`
// User is username from gitea
User string `yaml:"user"`
// Created is auto created unix timestamp
Created int64 `yaml:"created"`
// RefreshToken is used to renew the access token when it expires
RefreshToken string `yaml:"refresh_token"`
// TokenExpiry is when the token expires (unix timestamp)
TokenExpiry int64 `yaml:"token_expiry"`
}
Login represents a login to a gitea server, you even could add multiple logins for one gitea server
func GetDefaultLogin ¶
GetDefaultLogin return the default login
func GetLoginByHost ¶ added in v0.9.0
GetLoginByHost finds a login by it's server URL
func GetLoginByName ¶
GetLoginByName get login by name (case insensitive)
type Preferences ¶ added in v0.9.0
type Preferences struct {
// Prefer using an external text editor over inline multiline prompts
Editor bool `yaml:"editor"`
FlagDefaults FlagDefaults `yaml:"flag_defaults"`
}
Preferences that are stored in and read from the config file
func GetPreferences ¶ added in v0.9.0
func GetPreferences() Preferences
GetPreferences returns preferences based on the config file