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)
Types ¶
type LocalConfig ¶
type LocalConfig struct {
Logins []Login `yaml:"logins"`
}
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"` // User is username from gitea User string `yaml:"user"` // Created is auto created unix timestamp Created int64 `yaml:"created"` }
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 GetLoginByName ¶
GetLoginByName get login by name (case insensitive)
func InitCommand ¶
func InitCommand(repoFlag, loginFlag, remoteFlag string) (login *Login, owner string, reponame string)
InitCommand resolves the application context, and returns the active login, and if available the repo slug. It does this by reading the config file for logins, parsing the remotes of the .git repo specified in repoFlag or $PWD, and using overrides from command flags. If a local git repo can't be found, repo slug values are unset.