Documentation
¶
Index ¶
- Variables
- func CheckIfIncludeTag(repository string) bool
- func CheckInvalidChar(text string) bool
- func FormatByteSize(sizeInByte int64) (size string)
- func FormatSeconds(seconds int64) string
- func GenRepoUrl(srcReg string, dstReg string, dstRepo string, rawURL string) (src string, dst string)
- func GetBlobSuffix(b types.BlobInfo) string
- func InitI18nPrinter(defaultLang string)
- func InitLogger(logConfig []byte)
- func MakeSquashfs(logger CtxLogger, path string, fs string) error
- func ManifestHandler(m []byte, t string, i *ImageSource) ([]manifest.Manifest, error)
- func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser
- func NewSqfsFileSystem(sqfsFile string, home string) (*sqfsFileSystem, error)
- func NewStderrWrapper(logger CtxLogger) io.Writer
- func NewStdoutWrapper(logger CtxLogger) io.Writer
- func NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser
- func ShortenString(str string, n int) string
- func TestSquashfs() bool
- func TestTar() bool
- func UnSquashfs(logger CtxLogger, path string, fs string, noCmd bool) error
- type Client
- func (c *Client) ClearInvalidTask()
- func (c *Client) GenerateOfflineDownTask(url string, username string, password string) error
- func (c *Client) GenerateOfflineUploadTask(srcUrl string, url string, path string, username string, password string) error
- func (c *Client) GenerateOnlineTask(imgSrc string, userSrc string, pswdStr string, imgDst string, userDst string, ...) error
- func (c *Client) GetAFailedTask() (Task, bool)
- func (c *Client) GetATask() (Task, bool)
- func (c *Client) PutAFailedTask(failedTask Task)
- func (c *Client) PutAInvalidTask(invalidTask string)
- func (c *Client) PutATask(task Task)
- func (c *Client) Run()
- func (c *Client) TaskLen() int
- type CmdLogger
- type CompressionMetadata
- func (c *CompressionMetadata) AddDatafile(name string, num int64)
- func (c *CompressionMetadata) AddImage(name string, manifest string)
- func (c *CompressionMetadata) BlobDone(sha256 string, ref string)
- func (c *CompressionMetadata) BlobExists(sha256 string) bool
- func (c *CompressionMetadata) BlobStart(sha256 string, tid int) bool
- func (c *CompressionMetadata) ClearDoing(tid int)
- type CtxLogger
- type DingTalkAccess
- type DingTalkWapper
- type DockerSaver
- type History
- type ImageCompressedTarReader
- type ImageCompressedTarWriter
- type ImageDestination
- func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
- func (i *ImageDestination) Close() error
- func (i *ImageDestination) GetRegistry() string
- func (i *ImageDestination) GetRepository() string
- func (i *ImageDestination) GetTag() string
- func (i *ImageDestination) PushManifest(manifestByte []byte) error
- func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
- type ImageSource
- func (i *ImageSource) Close() error
- func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
- func (i *ImageSource) GetBlobInfos(manifestByte []byte, manifestType string) ([]types.BlobInfo, error)
- func (i *ImageSource) GetManifest() ([]byte, string, error)
- func (i *ImageSource) GetRegistry() string
- func (i *ImageSource) GetRepository() string
- func (i *ImageSource) GetSourceRepoTags() ([]string, error)
- func (i *ImageSource) GetTag() string
- type LocalCache
- func (c *LocalCache) Clean()
- func (c *LocalCache) Match(blobName string, size int64) (bool, string)
- func (c *LocalCache) Reuse(blobName string) (io.ReadCloser, error)
- func (c *LocalCache) SaveFile(filename string, reader io.ReadCloser, size int64) (string, error)
- func (c *LocalCache) SaveStream(blobName string, reader io.Reader) (io.ReadCloser, io.WriteCloser, error)
- type LocalTemp
- type Manifest
- type Notify
- type OfflineDownTask
- func (t *OfflineDownTask) Callback(success bool, content string)
- func (t *OfflineDownTask) Name() string
- func (t *OfflineDownTask) Run(tid int) error
- func (t *OfflineDownTask) StatDown(size int64, duration time.Duration)
- func (t *OfflineDownTask) StatUp(size int64, duration time.Duration)
- func (t *OfflineDownTask) Status() string
- type OfflineUploadTask
- func (t *OfflineUploadTask) Callback(bool, string)
- func (t *OfflineUploadTask) Name() string
- func (t *OfflineUploadTask) Run(tid int) error
- func (t *OfflineUploadTask) StatDown(size int64, duration time.Duration)
- func (t *OfflineUploadTask) StatUp(size int64, duration time.Duration)
- func (t *OfflineUploadTask) Status() string
- type OnlineTask
- func (t *OnlineTask) Callback(success bool, content string)
- func (t *OnlineTask) Name() string
- func (t *OnlineTask) Run(idx int) error
- func (t *OnlineTask) StatDown(size int64, duration time.Duration)
- func (t *OnlineTask) StatUp(size int64, duration time.Duration)
- func (t *OnlineTask) Status() string
- type ReaderSumWrapper
- type Repo
- type RepoURL
- func (r *RepoURL) GetNamespace() string
- func (r *RepoURL) GetOriginURL() string
- func (r *RepoURL) GetRegistry() string
- func (r *RepoURL) GetRepo() string
- func (r *RepoURL) GetRepoWithNamespace() string
- func (r *RepoURL) GetRepoWithTag() string
- func (r *RepoURL) GetTag() string
- func (r *RepoURL) GetURL() string
- func (r *RepoURL) GetURLWithoutTag() string
- type SingleTarWriter
- type SquashfsTar
- func (w *SquashfsTar) AppendFileStream(blobName string, size int64, reader io.ReadCloser) error
- func (w *SquashfsTar) AssembleTarStream(hex string) (io.Reader, error)
- func (w *SquashfsTar) DisassembleTarStream(hex string, size int64, reader io.ReadCloser) error
- func (w *SquashfsTar) GetFileStream(hex string) (io.Reader, error)
- func (w *SquashfsTar) TarSplitReader(hex string) (io.ReadCloser, error)
- type StderrWrapper
- type StdoutWrapper
- type Task
- func NewOfflineDownTask(ctx *TaskContext, url string, is *ImageSource) Task
- func NewOfflineUploadTask(ctx *TaskContext, ids *ImageDestination, url string, path string) Task
- func NewOnlineTask(source *ImageSource, destination *ImageDestination, ctx *TaskContext) Task
- func NewOnlineTaskCallback(source *ImageSource, destination *ImageDestination, ctx *TaskContext, ...) Task
- type TaskContext
- func (t *TaskContext) Cancel() bool
- func (t *TaskContext) CloseTarWriter()
- func (t *TaskContext) CreateCompressionMetadata(compressor string) error
- func (t *TaskContext) CreateSingleWriter(pathname string, filename string, compression string) error
- func (t *TaskContext) CreateSquashfsTar(tempPath string, workPath string, squashfsFileName string) error
- func (t *TaskContext) CreateTarWriter(pathname string, filename string, compression string, num int) error
- func (t *TaskContext) Debug(logStr string)
- func (t *TaskContext) Error(logStr string)
- func (t *TaskContext) Errorf(format string, args ...interface{}) error
- func (t *TaskContext) GetLogger() CtxLogger
- func (t *TaskContext) GetStatus() string
- func (t *TaskContext) GetTotalTask() int
- func (t *TaskContext) Info(logStr string)
- func (t *TaskContext) Reset()
- func (t *TaskContext) StatDown(size int64, duration time.Duration)
- func (t *TaskContext) StatUp(size int64, duration time.Duration)
- func (t *TaskContext) UpdateCurrentConn(n int)
- func (t *TaskContext) UpdateFailedTask(n int)
- func (t *TaskContext) UpdateInvalidTask(n int)
- func (t *TaskContext) UpdateSecEnd(n int64)
- func (t *TaskContext) UpdateSecStart(n int64)
- func (t *TaskContext) UpdateTotalTask(n int)
- func (t *TaskContext) UpdateWaitTask(n int)
- type YamlCfg
Constants ¶
This section is empty.
Variables ¶
var ( HOME = "data" TEMP_DIR = filepath.Join(HOME, "temp") HIS_FILE = filepath.Join(HOME, "history.yaml") SQUASHFS = true CONF *YamlCfg INTERVAL = 60 )
var I18n *message.Printer
var ( // NoCache used to disable a blobinfocache NoCache = none.NoCache )
Functions ¶
func CheckIfIncludeTag ¶
CheckIfIncludeTag checks if a repository string includes tag
func CheckInvalidChar ¶
func FormatByteSize ¶
func FormatSeconds ¶
func GenRepoUrl ¶
func GenRepoUrl(srcReg string, dstReg string, dstRepo string, rawURL string) (src string, dst string)
we support two cases: hub.docker.com/myrepo/img:tag https://hub.docker.com/myrepo/img:tag hub.docker.com/myrepo/img:tag -> newname:newtag hub.docker.com/myrepo/img:tag -> mynewrepo/newname:newtag hub.docker.com/myrepo/img:tag -> newhub.docker.com/mynewrepo/newname:newtag
func GetBlobSuffix ¶
func InitI18nPrinter ¶
func InitI18nPrinter(defaultLang string)
func InitLogger ¶
func InitLogger(logConfig []byte)
func ManifestHandler ¶
ManifestHandler expends the ability of handling manifest list in schema2, but it's not finished yet return the digest array of manifests in the manifest list if exist.
func NewReadCloserWrapper ¶
func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser
func NewSqfsFileSystem ¶
func NewStderrWrapper ¶
func NewStdoutWrapper ¶
func NewWriteCloserWrapper ¶
func NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser
func ShortenString ¶
func TestSquashfs ¶
func TestSquashfs() bool
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client describes a syncronization client
func NewClient ¶
func NewClient(routineNum int, retries int, logger *TaskContext) (*Client, error)
NewClient creates a syncronization client
func (*Client) ClearInvalidTask ¶
func (c *Client) ClearInvalidTask()
func (*Client) GenerateOfflineDownTask ¶
func (*Client) GenerateOfflineUploadTask ¶
func (*Client) GenerateOnlineTask ¶
func (*Client) GetAFailedTask ¶
GetAFailedTask gets a failed task from failedTaskList
func (*Client) PutAFailedTask ¶
PutAFailedTask puts a failed task to failedTaskList
func (*Client) PutAInvalidTask ¶
type CompressionMetadata ¶
type CompressionMetadata struct { Datafiles map[string]int64 Compressor string Blobs map[string][]string Manifests map[string]string BlobDoing map[string]int // contains filtered or unexported fields }
func NewCompressionMetadata ¶
func NewCompressionMetadata(compressor string) (*CompressionMetadata, error)
func (*CompressionMetadata) AddDatafile ¶
func (c *CompressionMetadata) AddDatafile(name string, num int64)
func (*CompressionMetadata) AddImage ¶
func (c *CompressionMetadata) AddImage(name string, manifest string)
func (*CompressionMetadata) BlobDone ¶
func (c *CompressionMetadata) BlobDone(sha256 string, ref string)
func (*CompressionMetadata) BlobExists ¶
func (c *CompressionMetadata) BlobExists(sha256 string) bool
func (*CompressionMetadata) BlobStart ¶
func (c *CompressionMetadata) BlobStart(sha256 string, tid int) bool
func (*CompressionMetadata) ClearDoing ¶
func (c *CompressionMetadata) ClearDoing(tid int)
type CtxLogger ¶
type CtxLogger interface { Debug(logStr string) Info(logStr string) Error(logStr string) Errorf(string, ...interface{}) error }
func NewCmdLogger ¶
func NewCmdLogger() CtxLogger
type DingTalkAccess ¶
type DingTalkWapper ¶
type DingTalkWapper struct {
// contains filtered or unexported fields
}
func (*DingTalkWapper) Send ¶
func (d *DingTalkWapper) Send(text string)
type DockerSaver ¶
type DockerSaver struct {
// contains filtered or unexported fields
}
Save image with docker tar format
func NewDockerSaver ¶
func NewDockerSaver(ctx *TaskContext, target string) *DockerSaver
func (*DockerSaver) AppendFileStream ¶
func (*DockerSaver) AppendMeta ¶
func (d *DockerSaver) AppendMeta(m *Manifest, url string)
func (*DockerSaver) Close ¶
func (d *DockerSaver) Close()
type ImageCompressedTarReader ¶
type ImageCompressedTarReader struct {
// contains filtered or unexported fields
}
func NewImageCompressedTarReader ¶
func NewImageCompressedTarReader(filename string, compression string) (*ImageCompressedTarReader, error)
func (*ImageCompressedTarReader) Close ¶
func (img *ImageCompressedTarReader) Close() error
func (*ImageCompressedTarReader) ReadFileStream ¶
func (*ImageCompressedTarReader) ReadFileStreamByName ¶
type ImageCompressedTarWriter ¶
type ImageCompressedTarWriter struct {
// contains filtered or unexported fields
}
func NewImageCompressedTarWriter ¶
func NewImageCompressedTarWriter(filename string, compression string) (*ImageCompressedTarWriter, error)
func (*ImageCompressedTarWriter) AppendFileStream ¶
func (img *ImageCompressedTarWriter) AppendFileStream(filename string, size int64, reader io.ReadCloser) error
func (*ImageCompressedTarWriter) Cleanup ¶
func (img *ImageCompressedTarWriter) Cleanup()
func (*ImageCompressedTarWriter) Close ¶
func (img *ImageCompressedTarWriter) Close() error
func (*ImageCompressedTarWriter) Flush ¶
func (img *ImageCompressedTarWriter) Flush()
type ImageDestination ¶
type ImageDestination struct {
// contains filtered or unexported fields
}
ImageDestination ids a reference of a remote image we will push to
func NewImageDestination ¶
func NewImageDestination(pCtx context.Context, registry, repository, tag, username, password string, insecure bool) (*ImageDestination, error)
NewImageDestination generates a ImageDestination by repository, the repository string must include "tag". If username or password ids empty, access to repository will be anonymous.
func (*ImageDestination) CheckBlobExist ¶
func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
CheckBlobExist checks if a blob exist for destination and reuse exist blobs
func (*ImageDestination) GetRegistry ¶
func (i *ImageDestination) GetRegistry() string
GetRegistry returns the registry of a ImageDestination
func (*ImageDestination) GetRepository ¶
func (i *ImageDestination) GetRepository() string
GetRepository returns the repository of a ImageDestination
func (*ImageDestination) GetTag ¶
func (i *ImageDestination) GetTag() string
GetTag return the tag of a ImageDestination
func (*ImageDestination) PushManifest ¶
func (i *ImageDestination) PushManifest(manifestByte []byte) error
PushManifest push a manifest file to destinate image
func (*ImageDestination) PutABlob ¶
func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
PutABlob push a blob to destinate image
type ImageSource ¶
type ImageSource struct {
// contains filtered or unexported fields
}
ImageSource ids a reference to a remote image need to be pulled.
func NewImageSource ¶
func NewImageSource(pCtx context.Context, registry, repository, tag, username, password string, insecure bool) (*ImageSource, error)
NewImageSource generates a PullTask by repository, the repository string must include "tag", if username or password ids empty, access to repository will be anonymous. a repository string ids the rest part of the images url except "tag" and "registry"
func (*ImageSource) GetABlob ¶
func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
GetABlob gets a blob from remote image
func (*ImageSource) GetBlobInfos ¶
func (i *ImageSource) GetBlobInfos(manifestByte []byte, manifestType string) ([]types.BlobInfo, error)
GetBlobInfos get blobs from source image.
func (*ImageSource) GetManifest ¶
func (i *ImageSource) GetManifest() ([]byte, string, error)
GetManifest get manifest file from source image
func (*ImageSource) GetRegistry ¶
func (i *ImageSource) GetRegistry() string
GetRegistry returns the registry of a ImageSource
func (*ImageSource) GetRepository ¶
func (i *ImageSource) GetRepository() string
GetRepository returns the repository of a ImageSource
func (*ImageSource) GetSourceRepoTags ¶
func (i *ImageSource) GetSourceRepoTags() ([]string, error)
GetSourceRepoTags gets all the tags of a repository which ImageSource belongs to
func (*ImageSource) GetTag ¶
func (i *ImageSource) GetTag() string
GetTag returns the tag of a ImageSource
type LocalCache ¶
type LocalCache struct { Pathname string `yaml:"pathname"` KeepDays int `yaml:"keepdays"` KeepSize int `yaml:"keepsize"` }
func NewLocalCache ¶
func NewLocalCache(pathname string, keepDays int, keepSize int) *LocalCache
func (*LocalCache) Clean ¶
func (c *LocalCache) Clean()
func (*LocalCache) Reuse ¶
func (c *LocalCache) Reuse(blobName string) (io.ReadCloser, error)
func (*LocalCache) SaveFile ¶
func (c *LocalCache) SaveFile(filename string, reader io.ReadCloser, size int64) (string, error)
func (*LocalCache) SaveStream ¶
func (c *LocalCache) SaveStream(blobName string, reader io.Reader) (io.ReadCloser, io.WriteCloser, error)
type LocalTemp ¶
type LocalTemp struct {
// contains filtered or unexported fields
}
func NewLocalTemp ¶
type Notify ¶
type Notify interface {
Send(text string)
}
func NewDingTalkWapper ¶
func NewDingTalkWapper(dtas []DingTalkAccess) Notify
type OfflineDownTask ¶
type OfflineDownTask struct {
// contains filtered or unexported fields
}
func (*OfflineDownTask) Callback ¶
func (t *OfflineDownTask) Callback(success bool, content string)
func (*OfflineDownTask) Name ¶
func (t *OfflineDownTask) Name() string
func (*OfflineDownTask) Run ¶
func (t *OfflineDownTask) Run(tid int) error
func (*OfflineDownTask) StatDown ¶
func (t *OfflineDownTask) StatDown(size int64, duration time.Duration)
func (*OfflineDownTask) StatUp ¶
func (t *OfflineDownTask) StatUp(size int64, duration time.Duration)
func (*OfflineDownTask) Status ¶
func (t *OfflineDownTask) Status() string
type OfflineUploadTask ¶
type OfflineUploadTask struct {
// contains filtered or unexported fields
}
func (*OfflineUploadTask) Callback ¶
func (t *OfflineUploadTask) Callback(bool, string)
func (*OfflineUploadTask) Name ¶
func (t *OfflineUploadTask) Name() string
func (*OfflineUploadTask) Run ¶
func (t *OfflineUploadTask) Run(tid int) error
func (*OfflineUploadTask) StatDown ¶
func (t *OfflineUploadTask) StatDown(size int64, duration time.Duration)
func (*OfflineUploadTask) StatUp ¶
func (t *OfflineUploadTask) StatUp(size int64, duration time.Duration)
func (*OfflineUploadTask) Status ¶
func (t *OfflineUploadTask) Status() string
type OnlineTask ¶
type OnlineTask struct {
// contains filtered or unexported fields
}
Task act as a action, it will pull a images from source to destination
func (*OnlineTask) Callback ¶
func (t *OnlineTask) Callback(success bool, content string)
func (*OnlineTask) Name ¶
func (t *OnlineTask) Name() string
func (*OnlineTask) Run ¶
func (t *OnlineTask) Run(idx int) error
Run ids the main function of a task
func (*OnlineTask) Status ¶
func (t *OnlineTask) Status() string
type ReaderSumWrapper ¶
type ReaderSumWrapper struct { Size int64 // contains filtered or unexported fields }
func NewReaderSumWrapper ¶
func NewReaderSumWrapper(reader io.Reader) *ReaderSumWrapper
type RepoURL ¶
type RepoURL struct {
// contains filtered or unexported fields
}
The RepoURL will divide a images url to <registry>/<namespace>/<repo>:<tag>
func (*RepoURL) GetNamespace ¶
GetNamespace returns the namespace in a url
func (*RepoURL) GetOriginURL ¶
GetOriginURL returns the whole url
func (*RepoURL) GetRegistry ¶
GetRegistry returns the registry in a url
func (*RepoURL) GetRepoWithNamespace ¶
GetRepoWithNamespace returns namespace/repository in a url
func (*RepoURL) GetRepoWithTag ¶
GetRepoWithTag returns repository:tag in a url
func (*RepoURL) GetURLWithoutTag ¶
GetURLWithoutTag returns registry/namespace/repository in a url
type SingleTarWriter ¶
type SingleTarWriter struct {
// contains filtered or unexported fields
}
func NewSingleTarWriter ¶
func NewSingleTarWriter(ctx *TaskContext, filename string, compression string) (*SingleTarWriter, error)
func (*SingleTarWriter) PutFile ¶
func (s *SingleTarWriter) PutFile(filename string)
func (*SingleTarWriter) Run ¶
func (s *SingleTarWriter) Run()
func (*SingleTarWriter) SaveDockerMeta ¶
func (s *SingleTarWriter) SaveDockerMeta(cm *CompressionMetadata)
func (*SingleTarWriter) SetQuit ¶
func (s *SingleTarWriter) SetQuit()
type SquashfsTar ¶
type SquashfsTar struct {
// contains filtered or unexported fields
}
func NewSquashfsTar ¶
func NewSquashfsTar(tempPath string, workPath string, squashfsFileName string) (*SquashfsTar, error)
func (*SquashfsTar) AppendFileStream ¶
func (w *SquashfsTar) AppendFileStream(blobName string, size int64, reader io.ReadCloser) error
func (*SquashfsTar) AssembleTarStream ¶
func (w *SquashfsTar) AssembleTarStream(hex string) (io.Reader, error)
func (*SquashfsTar) DisassembleTarStream ¶
func (w *SquashfsTar) DisassembleTarStream(hex string, size int64, reader io.ReadCloser) error
func (*SquashfsTar) GetFileStream ¶
func (w *SquashfsTar) GetFileStream(hex string) (io.Reader, error)
func (*SquashfsTar) TarSplitReader ¶
func (w *SquashfsTar) TarSplitReader(hex string) (io.ReadCloser, error)
type StderrWrapper ¶
type StderrWrapper struct {
// contains filtered or unexported fields
}
type StdoutWrapper ¶
type StdoutWrapper struct {
// contains filtered or unexported fields
}
type Task ¶
type Task interface { Run(int) error Name() string Callback(bool, string) StatDown(int64, time.Duration) StatUp(int64, time.Duration) Status() string }
func NewOfflineDownTask ¶
func NewOfflineDownTask(ctx *TaskContext, url string, is *ImageSource) Task
func NewOfflineUploadTask ¶
func NewOfflineUploadTask(ctx *TaskContext, ids *ImageDestination, url string, path string) Task
func NewOnlineTask ¶
func NewOnlineTask(source *ImageSource, destination *ImageDestination, ctx *TaskContext) Task
NewTask creates a task
func NewOnlineTaskCallback ¶
func NewOnlineTaskCallback(source *ImageSource, destination *ImageDestination, ctx *TaskContext, callback func(bool, string)) Task
type TaskContext ¶
type TaskContext struct { Cache *LocalCache Temp *LocalTemp History *History TarWriter []*ImageCompressedTarWriter SingleWriter *SingleTarWriter CompMeta *CompressionMetadata SquashfsTar *SquashfsTar Context context.Context CancelFunc context.CancelFunc Notify Notify DockerTarget string // contains filtered or unexported fields }
func NewTaskContext ¶
func NewTaskContext(log CtxLogger, lc *LocalCache, lt *LocalTemp) *TaskContext
func (*TaskContext) Cancel ¶
func (t *TaskContext) Cancel() bool
func (*TaskContext) CloseTarWriter ¶
func (t *TaskContext) CloseTarWriter()
func (*TaskContext) CreateCompressionMetadata ¶
func (t *TaskContext) CreateCompressionMetadata(compressor string) error
func (*TaskContext) CreateSingleWriter ¶
func (t *TaskContext) CreateSingleWriter(pathname string, filename string, compression string) error
func (*TaskContext) CreateSquashfsTar ¶
func (t *TaskContext) CreateSquashfsTar(tempPath string, workPath string, squashfsFileName string) error
func (*TaskContext) CreateTarWriter ¶
func (*TaskContext) Debug ¶
func (t *TaskContext) Debug(logStr string)
func (*TaskContext) Error ¶
func (t *TaskContext) Error(logStr string)
func (*TaskContext) Errorf ¶
func (t *TaskContext) Errorf(format string, args ...interface{}) error
func (*TaskContext) GetLogger ¶
func (t *TaskContext) GetLogger() CtxLogger
func (*TaskContext) GetStatus ¶
func (t *TaskContext) GetStatus() string
func (*TaskContext) GetTotalTask ¶
func (t *TaskContext) GetTotalTask() int
func (*TaskContext) Info ¶
func (t *TaskContext) Info(logStr string)
func (*TaskContext) Reset ¶
func (t *TaskContext) Reset()
func (*TaskContext) UpdateCurrentConn ¶
func (t *TaskContext) UpdateCurrentConn(n int)
func (*TaskContext) UpdateFailedTask ¶
func (t *TaskContext) UpdateFailedTask(n int)
func (*TaskContext) UpdateInvalidTask ¶
func (t *TaskContext) UpdateInvalidTask(n int)
func (*TaskContext) UpdateSecEnd ¶
func (t *TaskContext) UpdateSecEnd(n int64)
func (*TaskContext) UpdateSecStart ¶
func (t *TaskContext) UpdateSecStart(n int64)
func (*TaskContext) UpdateTotalTask ¶
func (t *TaskContext) UpdateTotalTask(n int)
func (*TaskContext) UpdateWaitTask ¶
func (t *TaskContext) UpdateWaitTask(n int)
type YamlCfg ¶
type YamlCfg struct { SrcRepos []Repo `yaml:"source,omitempty"` DstRepos []Repo `yaml:"target,omitempty"` MaxConn int `yaml:"maxconn,omitempty"` Retries int `yaml:"retries,omitempty"` SingleFile bool `yaml:"singlefile,omitempty"` DockerFile bool `yaml:"dockerfile,omitempty"` Compressor string `yaml:"compressor,omitempty"` Squashfs string `yaml:"squashfs,omitempty"` Cache LocalCache `yaml:"cache,omitempty"` Lang string `yaml:"lang,omitempty"` KeepTemp bool `yaml:"keeptemp,omitempty"` OutPrefix string `yaml:"outprefix,omitempty"` Interval int `yaml:"interval,omitempty"` DingTalk []DingTalkAccess `yaml:"dingtalk,omitempty"` }