Documentation
¶
Index ¶
- func Download(token string, registry string) (string, error)
- func Upload(token string, registry string, data string) (string, error)
- type ClientContext
- func (c *ClientContext) Connect(ctx context.Context, retry bool) error
- func (c *ClientContext) Export() (string, string, error)
- func (c *ClientContext) GetClientNoTimeout() *http.Client
- func (c *ClientContext) GetHTTPClient() *http.Client
- func (c *ClientContext) ImportCertificates(ctx context.Context, sshDir string) error
- func (c *ClientContext) Load() error
- func (c *ClientContext) Save() error
- func (c *ClientContext) WithAPIURL(url string) *ClientContext
- func (c *ClientContext) WithCredentials(creds *Credentials) *ClientContext
- func (c *ClientContext) WithName(name string) *ClientContext
- type Config
- type Credentials
- type FileStorage
- func (fs *FileStorage) Delete(name string) error
- func (fs *FileStorage) GetActive() (string, error)
- func (fs *FileStorage) List() ([]string, error)
- func (fs *FileStorage) Load(name string) (*ClientContext, error)
- func (fs *FileStorage) Save(ctx *ClientContext) error
- func (fs *FileStorage) SetActive(name string) error
- type Manager
- func (m *Manager) CreateContext(name, apiURL string, creds *Credentials) (*ClientContext, error)
- func (m *Manager) DeleteContext(name string) error
- func (m *Manager) Download(token string, registry string) (string, error)
- func (m *Manager) ExportContext(name string, api string) (string, string, error)
- func (m *Manager) GetActive() (*ClientContext, error)
- func (m *Manager) GetContext(name string) (*ClientContext, error)
- func (m *Manager) ImportContext(encrypted, key string) (*ClientContext, error)
- func (m *Manager) ListContexts() ([]string, error)
- func (m *Manager) SetActive(name string) error
- func (m *Manager) Upload(token string, registry string, data string) (string, error)
- type MemoryStorage
- func (ms *MemoryStorage) Delete(name string) error
- func (ms *MemoryStorage) GetActive() (string, error)
- func (ms *MemoryStorage) List() ([]string, error)
- func (ms *MemoryStorage) Load(name string) (*ClientContext, error)
- func (ms *MemoryStorage) Save(ctx *ClientContext) error
- func (ms *MemoryStorage) SetActive(name string) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientContext ¶
type ClientContext struct {
Name string
Directory string `json:"-"`
APIURL string
Credentials *Credentials
// contains filtered or unexported fields
}
func LoadActive ¶
func LoadActive(cfg *Config) (*ClientContext, error)
func LoadByName ¶
func LoadByName(name string, cfg *Config) (*ClientContext, error)
func NewContext ¶
func NewContext(cfg *Config) (*ClientContext, error)
func (*ClientContext) Connect ¶
func (c *ClientContext) Connect(ctx context.Context, retry bool) error
func (*ClientContext) GetClientNoTimeout ¶
func (c *ClientContext) GetClientNoTimeout() *http.Client
func (*ClientContext) GetHTTPClient ¶
func (c *ClientContext) GetHTTPClient() *http.Client
func (*ClientContext) ImportCertificates ¶
func (c *ClientContext) ImportCertificates(ctx context.Context, sshDir string) error
func (*ClientContext) Load ¶
func (c *ClientContext) Load() error
func (*ClientContext) Save ¶
func (c *ClientContext) Save() error
func (*ClientContext) WithAPIURL ¶
func (c *ClientContext) WithAPIURL(url string) *ClientContext
func (*ClientContext) WithCredentials ¶
func (c *ClientContext) WithCredentials(creds *Credentials) *ClientContext
func (*ClientContext) WithName ¶
func (c *ClientContext) WithName(name string) *ClientContext
type Config ¶
type Config struct {
RootDir string
APITimeout time.Duration
MaxRetries int
RetryDelay time.Duration
UseInsecure bool
InMemory bool
}
func DefaultConfig ¶
type Credentials ¶
type Credentials struct {
PrivateKey *bytes.Buffer
Cert *bytes.Buffer
Ca *bytes.Buffer
CertBundle string
User *authentication.User
}
func BundleToCredentials ¶
func BundleToCredentials(bundle interface{}) (*Credentials, error)
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage(contextDir string) *FileStorage
func (*FileStorage) Delete ¶
func (fs *FileStorage) Delete(name string) error
func (*FileStorage) GetActive ¶
func (fs *FileStorage) GetActive() (string, error)
func (*FileStorage) List ¶
func (fs *FileStorage) List() ([]string, error)
func (*FileStorage) Load ¶
func (fs *FileStorage) Load(name string) (*ClientContext, error)
func (*FileStorage) Save ¶
func (fs *FileStorage) Save(ctx *ClientContext) error
func (*FileStorage) SetActive ¶
func (fs *FileStorage) SetActive(name string) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CreateContext ¶
func (m *Manager) CreateContext(name, apiURL string, creds *Credentials) (*ClientContext, error)
func (*Manager) DeleteContext ¶
func (*Manager) ExportContext ¶
func (*Manager) GetActive ¶
func (m *Manager) GetActive() (*ClientContext, error)
func (*Manager) GetContext ¶
func (m *Manager) GetContext(name string) (*ClientContext, error)
func (*Manager) ImportContext ¶
func (m *Manager) ImportContext(encrypted, key string) (*ClientContext, error)
func (*Manager) ListContexts ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
func (*MemoryStorage) Delete ¶
func (ms *MemoryStorage) Delete(name string) error
func (*MemoryStorage) GetActive ¶
func (ms *MemoryStorage) GetActive() (string, error)
func (*MemoryStorage) List ¶
func (ms *MemoryStorage) List() ([]string, error)
func (*MemoryStorage) Load ¶
func (ms *MemoryStorage) Load(name string) (*ClientContext, error)
func (*MemoryStorage) Save ¶
func (ms *MemoryStorage) Save(ctx *ClientContext) error
func (*MemoryStorage) SetActive ¶
func (ms *MemoryStorage) SetActive(name string) error
Click to show internal directories.
Click to hide internal directories.