client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileLogger

func NewFileLogger(path string) *logrus.Logger

create a log file and init logger

Types

type Auth

type Auth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewSyncClient

func NewSyncClient(configFile, logFile, recordsFile string, routineNum, retries int, defaultDestRegistry string, defaultDestNamespace string) (*Client, error)

func (*Client) GenerateSyncTask

func (c *Client) GenerateSyncTask(source string, destination string) ([]*UrlPair, error)

func (*Client) GetAFailedTask

func (c *Client) GetAFailedTask() (*sync.SyncTask, bool)

func (*Client) GetAFailedUrlPair

func (c *Client) GetAFailedUrlPair() (*UrlPair, bool)

func (*Client) GetATask

func (c *Client) GetATask() (*sync.SyncTask, bool)

return a SyncTask struct and if the task list is empty

func (*Client) GetAUrlPair

func (c *Client) GetAUrlPair() (*UrlPair, bool)

func (*Client) PutAFailedTask

func (c *Client) PutAFailedTask(failedTask *sync.SyncTask)

func (*Client) PutAFailedUrlPair

func (c *Client) PutAFailedUrlPair(failedUrlPair *UrlPair)

func (*Client) PutATask

func (c *Client) PutATask(task *sync.SyncTask)

func (*Client) PutUrlPairs

func (c *Client) PutUrlPairs(urlPairs []*UrlPair)

func (*Client) Run

func (c *Client) Run()

type Config

type Config struct {
	// the authentication information of each registry
	AuthList map[string]Auth `json:"auth"`

	// a <source_repo>:<dest_repo> map
	ImageList map[string]string `json:"images"`
	// contains filtered or unexported fields
}

The configure infomation of sync client

func NewSyncConfig

func NewSyncConfig(configFilePath, defaultDestRegistry, defaultDestNamespace string) (*Config, error)

func (*Config) GetAuth

func (c *Config) GetAuth(registry string) (Auth, bool)

func (*Config) GetImageList

func (c *Config) GetImageList() map[string]string

type UrlPair

type UrlPair struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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