Documentation ¶
Index ¶
- func NewFileLogger(path string) *logrus.Logger
- type Auth
- type Client
- func (c *Client) GenerateSyncTask(source string, destination string) ([]*URLPair, error)
- func (c *Client) GetAFailedTask() (*sync.Task, bool)
- func (c *Client) GetAFailedURLPair() (*URLPair, bool)
- func (c *Client) GetATask() (*sync.Task, bool)
- func (c *Client) GetAURLPair() (*URLPair, bool)
- func (c *Client) PutAFailedTask(failedTask *sync.Task)
- func (c *Client) PutAFailedURLPair(failedURLPair *URLPair)
- func (c *Client) PutATask(task *sync.Task)
- func (c *Client) PutURLPairs(urlPairs []*URLPair)
- func (c *Client) Run()
- type Config
- type URLPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileLogger ¶
NewFileLogger creates a log file and init logger
Types ¶
type Auth ¶
type Auth struct { Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Insecure bool `json:"insecure" yaml:"insecure"` }
Auth describes the authentication information of a registry
type Client ¶
type Client struct { // a sync.Task list TaskList *list.List // a URLPair list UrlPairList *list.List // failed list FailedTaskList *list.List FailedTaskGenerateList *list.List Config *Config RoutineNum int Retries int Logger *logrus.Logger // mutex TaskListChan chan int UrlPairListChan chan int FailedTaskListChan chan int FailedTaskGenerateListChan chan int }
Client describes a synchronization client
func NewSyncClient ¶
func NewSyncClient(configFile, authFile, imageFile, logFile string, routineNum, retries int, defaultDestRegistry, defaultDestNamespace string, osFilterList, archFilterList []string) (*Client, error)
NewSyncClient creates a synchronization client
func (*Client) GenerateSyncTask ¶
GenerateSyncTask creates synchronization tasks from source and destination url, return URLPair array if there are more than one tags
func (*Client) GetAFailedTask ¶
GetAFailedTask gets a failed task from failedTaskList
func (*Client) GetAFailedURLPair ¶ added in v1.0.3
GetAFailedURLPair get a URLPair from failedTaskGenerateList
func (*Client) GetAURLPair ¶ added in v1.0.3
GetAURLPair gets a URLPair from urlPairList
func (*Client) PutAFailedTask ¶
PutAFailedTask puts a failed task to failedTaskList
func (*Client) PutAFailedURLPair ¶ added in v1.0.3
PutAFailedURLPair puts a URLPair to failedTaskGenerateList
func (*Client) PutURLPairs ¶ added in v1.0.3
PutURLPairs puts a URLPair array to urlPairList
type Config ¶
type Config struct { // the authentication information of each registry AuthList map[string]Auth `json:"auth" yaml:"auth"` // a <source_repo>:<dest_repo> map ImageList map[string]string `json:"images" yaml:"images"` // contains filtered or unexported fields }
Config information of sync client
func NewSyncConfig ¶
func NewSyncConfig(configFile, authFilePath, imageFilePath, defaultDestRegistry, defaultDestNamespace string, osFilterList, archFilterList []string) (*Config, error)
NewSyncConfig creates a Config struct
func (*Config) GetImageList ¶
GetImageList gets the ImageList map in Config