Documentation ¶
Overview ¶
Package cueconfig holds internal API relating to CUE configuration.
Index ¶
- func CacheDir(getenv func(string) string) (string, error)
- func ConfigDir(getenv func(string) string) (string, error)
- func LoginConfigPath(getenv func(string) string) (string, error)
- func RegistryOAuthConfig(host modresolve.Host) oauth2.Config
- func TokenFromLogin(login RegistryLogin) *oauth2.Token
- func WriteLogins(path string, logins *Logins) error
- type Logins
- type RegistryLogin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegistryOAuthConfig ¶
func RegistryOAuthConfig(host modresolve.Host) oauth2.Config
RegistryOAuthConfig returns the oauth2 configuration suitable for talking to the central registry.
func TokenFromLogin ¶
func TokenFromLogin(login RegistryLogin) *oauth2.Token
func WriteLogins ¶
Types ¶
type Logins ¶
type Logins struct {
Registries map[string]RegistryLogin `json:"registries"`
}
Logins holds the login information as stored in $CUE_CONFIG_DIR/logins.cue.
func ReadLogins ¶
type RegistryLogin ¶
type RegistryLogin struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Expiry *time.Time `json:"expiry,omitempty"` }
RegistryLogin holds the login information for one registry.
func LoginFromToken ¶
func LoginFromToken(tok *oauth2.Token) RegistryLogin
Click to show internal directories.
Click to hide internal directories.