Documentation ¶
Index ¶
Constants ¶
const ( // StateInitialize ... StateInitialize = "initialize" // StateCheck ... StateCheck = "check" // StatePullManifest ... StatePullManifest = "pull_manifest" // StateTransferBlob ... StateTransferBlob = "transfer_blob" // StatePushManifest ... StatePushManifest = "push_manifest" )
const (
// StateDelete ...
StateDelete = "delete"
)
Variables ¶
var ( // ErrConflict represents http 409 error ErrConflict = errors.New("conflict") )
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
BaseHandler holds informations shared by other state handlers
func InitBaseHandler ¶
func InitBaseHandler(repository, srcURL, srcSecret, dstURL, dstUsr, dstPwd string, insecure bool, tags []string, logger *log.Logger) *BaseHandler
InitBaseHandler initializes a BaseHandler.
type BlobTransfer ¶
type BlobTransfer struct {
*BaseHandler
}
BlobTransfer transfers blobs of a tag
func (*BlobTransfer) Enter ¶
func (b *BlobTransfer) Enter() (string, error)
Enter pulls blobs and then pushs them to destination registry.
type Checker ¶
type Checker struct {
*BaseHandler
}
Checker checks the existence of project and the user's privlege to the project
type Deleter ¶
type Deleter struct {
// contains filtered or unexported fields
}
Deleter deletes repository or tags
type Initializer ¶
type Initializer struct {
*BaseHandler
}
Initializer creates clients for source and destination registry, lists tags of the repository if parameter tags is nil.
type ManifestPuller ¶
type ManifestPuller struct {
*BaseHandler
}
ManifestPuller pulls the manifest of a tag. And if no tag needs to be pulled, the next state that state machine should enter is "finished".
func (*ManifestPuller) Enter ¶
func (m *ManifestPuller) Enter() (string, error)
Enter pulls manifest of a tag and checks if all blobs exist in the destination registry
type ManifestPusher ¶
type ManifestPusher struct {
*BaseHandler
}
ManifestPusher pushs the manifest to destination registry
func (*ManifestPusher) Enter ¶
func (m *ManifestPusher) Enter() (string, error)
Enter checks the existence of manifest in the source registry first, and if it exists, pushs it to destination registry. The checking operation is to avoid the situation that the tag is deleted during the blobs transfering