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"` Password string `json:"password"` Insecure bool `json:"insecure"` }
Auth describes the authentication information of a registry
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client describes a synchronization client
func NewSyncClient ¶
func NewSyncClient(configFile, logFile, recordsFile string, routineNum, retries int, defaultDestRegistry string, defaultDestNamespace 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"` // a <source_repo>:<dest_repo> map ImageList map[string]string `json:"images"` // contains filtered or unexported fields }
Config information of sync client
func NewSyncConfig ¶
func NewSyncConfig(configFilePath, defaultDestRegistry, defaultDestNamespace string) (*Config, error)
NewSyncConfig creates a Config struct
func (*Config) GetImageList ¶
GetImageList gets the ImageList map in Config