Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) Add(name string, e *endpoint.Config) error
- func (c *Config) GetDefault() (*endpoint.Config, error)
- func (c *Config) GetRemote(name string) (*endpoint.Config, error)
- func (c *Config) Login(uri, username, password string, insecure bool, reqAuthFile string) error
- func (c *Config) Logout(uri string, reqAuthFile string) error
- func (c *Config) Remove(name string) error
- func (c *Config) Rename(name, newName string) error
- func (c *Config) SetDefault(name string, exclusive bool) error
- func (c *Config) SyncFrom(sys *Config) error
- func (c *Config) WriteTo(w io.Writer) (int64, error)
Constants ¶
const (
// DefaultRemoteName is the default remote name
DefaultRemoteName = "SylabsCloud"
)
Variables ¶
var DefaultRemoteConfig = &Config{ DefaultRemote: DefaultRemoteName, Remotes: map[string]*endpoint.Config{ DefaultRemoteName: endpoint.DefaultEndpointConfig, }, }
DefaultRemoteConfig holds the default remote configuration if there is no remote.yaml present both in user home directory and in system location.
var ErrNoDefault = errors.New("no default remote")
ErrNoDefault indicates no default remote being set
var SystemConfigPath = filepath.Join(buildcfg.SYSCONFDIR, "singularity", syfs.RemoteConfFile)
SystemConfigPath holds the path to the remote system configuration.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DefaultRemote string `yaml:"Active"` Remotes map[string]*endpoint.Config `yaml:"Remotes"` Credentials []*credential.Config `yaml:"Credentials,omitempty"` // contains filtered or unexported fields }
Config stores the state of remote endpoint configurations
func ReadFrom ¶
ReadFrom reads remote configuration from io.Reader returns Config populated with remotes
func (*Config) GetDefault ¶
GetDefault returns default remote endpoint or an error
func (*Config) GetRemote ¶
GetRemote returns a reference to an existing endpoint returns error if remote does not exist
func (*Config) Login ¶
Login validates and stores credentials for a service like Docker/OCI registries and keyservers.
func (*Config) Remove ¶
Remove a remote endpoint if endpoint is the default, the default is cleared returns an error if it does not exist
func (*Config) SetDefault ¶
SetDefault sets default remote endpoint or returns an error if it does not exist. A remote endpoint can also be set as exclusive.
func (*Config) SyncFrom ¶
SyncFrom updates c with the remotes specified in sys. Typically, this is used to sync a globally-configured remote.Config into a user-specific remote.Config. Currently, SyncFrom will return a name-collision error if there is an EndPoint name which exists in both c & sys, and the EndPoint in c has System == false.