remote

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRemoteName is the default remote name
	DefaultRemoteName = "DefaultRemote"
)

Variables

View Source
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.

View Source
var ErrNoDefault = errors.New("no default remote")

ErrNoDefault indicates no default remote being set

View Source
var SystemConfigPath = filepath.Join(buildcfg.SYSCONFDIR, "apptainer", 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

func ReadFrom(r io.Reader) (*Config, error)

ReadFrom reads remote configuration from io.Reader returns Config populated with remotes

func (*Config) Add

func (c *Config) Add(name string, e *endpoint.Config) error

Add a new remote endpoint returns an error if it already exists

func (*Config) GetDefault

func (c *Config) GetDefault() (*endpoint.Config, error)

GetDefault returns default remote endpoint or an error

func (*Config) GetRemote

func (c *Config) GetRemote(name string) (*endpoint.Config, error)

GetRemote returns a reference to an existing endpoint returns error if remote does not exist

func (*Config) Login

func (c *Config) Login(uri, username, password string, insecure bool) error

Login validates and stores credentials for a service like Docker/OCI registries and keyservers.

func (*Config) Logout

func (c *Config) Logout(uri string) error

Logout removes previously stored credentials for a service.

func (*Config) Remove

func (c *Config) Remove(name string) error

Remove a remote endpoint if endpoint is the default, the default is cleared returns an error if it does not exist

func (*Config) Rename

func (c *Config) Rename(name, newName string) error

Rename an existing remote returns an error if it does not exist

func (*Config) SetDefault

func (c *Config) SetDefault(name string, exclusive bool) error

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

func (c *Config) SyncFrom(sys *Config) error

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.

func (*Config) WriteTo

func (c *Config) WriteTo(w io.Writer) (int64, error)

WriteTo writes the configuration to the io.Writer returns and error if write is incomplete

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL