Documentation
¶
Index ¶
- Constants
- Variables
- func FindScpLikeComponents(url string) (user, host, port, path string)
- func IsRemoteEndpoint(url string) bool
- func MatchesScheme(url string) bool
- func MatchesScpLike(url string) bool
- func NewObjectsReader(objects []plumbing.Hash) io.ReadCloser
- type BatchRequest
- type BatchResponse
- type BatchShareObjectsRequest
- type BatchShareObjectsResponse
- type Command
- type Endpoint
- type HaveObject
- type MetadataOptions
- type Operation
- type Options
- type Reference
- type Representation
- type SASHandshake
- type SASPayload
- type SessionReader
- type SizeReader
- type Transport
- type WantObject
Constants ¶
View Source
const ( Shallow = 1 AnyDepth = -1 AnyDeepen = -1 )
Variables ¶
View Source
var ( ErrRepositoryNotFound = errors.New("repository not found") ErrReferenceNotExist = errors.New("reference not exist") )
Functions ¶
func FindScpLikeComponents ¶
FindScpLikeComponents returns the user, host, port and path of the given SCP-like URL.
func IsRemoteEndpoint ¶
func MatchesScheme ¶
MatchesScheme returns true if the given string matches a URL-like format scheme.
func MatchesScpLike ¶
MatchesScpLike returns true if the given string matches an SCP-like format scheme.
func NewObjectsReader ¶ added in v0.17.0
func NewObjectsReader(objects []plumbing.Hash) io.ReadCloser
Types ¶
type BatchRequest ¶
type BatchRequest struct {
Objects []*HaveObject `json:"objects"`
}
type BatchResponse ¶
type BatchResponse struct {
Objects []*HaveObject `json:"objects"`
}
type BatchShareObjectsRequest ¶ added in v0.17.0
type BatchShareObjectsRequest struct {
}
type BatchShareObjectsResponse ¶ added in v0.17.0
type BatchShareObjectsResponse struct {
}
type Endpoint ¶
type Endpoint struct {
url.URL
// InsecureSkipTLS skips ssl verify if protocol is https
InsecureSkipTLS bool
// ExtraHeader extra header
ExtraHeader map[string]string
// ExtraEnv extra env
ExtraEnv map[string]string
// CredentialStorage specifies the credential storage backend (Linux only)
CredentialStorage string
// CredentialEncryptionKey specifies the encryption key for file storage
CredentialEncryptionKey string
// CredentialStoragePath specifies the path for encrypted credential file
CredentialStoragePath string
// contains filtered or unexported fields
}
Endpoint represents a zeta URL in any supported protocol.
type HaveObject ¶
type MetadataOptions ¶
type Reference ¶
type Reference struct {
Remote string `json:"remote"`
Name plumbing.ReferenceName `json:"name"`
Hash string `json:"hash"`
Peeled string `json:"peeled,omitempty"`
HEAD string `json:"head"`
Version int `json:"version"`
Agent string `json:"agent"`
HashAlgo string `json:"hash-algo"`
CompressionALGO string `json:"compression-algo"`
Capabilities []string `json:"capabilities"`
}
type Representation ¶
type Representation struct {
OID string `json:"oid"`
CompressedSize int64 `json:"compressed_size"`
Href string `json:"href"`
Header map[string]string `json:"header,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitzero"`
}
func (*Representation) Copy ¶
func (r *Representation) Copy() *Representation
func (*Representation) IsExpired ¶
func (r *Representation) IsExpired() bool
type SASHandshake ¶ added in v0.17.0
type SASPayload ¶
type SASPayload struct {
Header map[string]string `json:"header,omitempty"`
Notice string `json:"notice,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitzero"`
}
func (*SASPayload) IsExpired ¶
func (p *SASPayload) IsExpired() bool
type SizeReader ¶
type Transport ¶
type Transport interface {
// FetchReference: discover reference and remote repo info and caps
FetchReference(ctx context.Context, refname plumbing.ReferenceName) (*Reference, error)
// FetchMetadata: support base metadata and sparse metadata.
// target: commit or tag
FetchMetadata(ctx context.Context, target plumbing.Hash, opts *MetadataOptions) (SessionReader, error)
// BatchMetadata: batch download metadata
BatchMetadata(ctx context.Context, oids []plumbing.Hash, depth int) (SessionReader, error)
// BatchObjects: batch download objects AKA blobs
BatchObjects(ctx context.Context, oids []plumbing.Hash) (SessionReader, error)
// GetObject: get large object, support Range feature
GetObject(ctx context.Context, oid plumbing.Hash, fromByte int64) (SizeReader, error)
Share(ctx context.Context, wantObjects []*WantObject) ([]*Representation, error)
// Push: push metadata and blobs to remote and update reference
Push(ctx context.Context, r io.Reader, cmd *Command) (rc SessionReader, err error)
// BatchCheck: check large objects exists in remote
BatchCheck(ctx context.Context, refname plumbing.ReferenceName, haveObjects []*HaveObject) ([]*HaveObject, error)
// PutObject: upload large object to remote
PutObject(ctx context.Context, refname plumbing.ReferenceName, oid plumbing.Hash, r io.Reader, size int64) error
}
type WantObject ¶
type WantObject struct {
OID string `json:"oid"`
}
Click to show internal directories.
Click to hide internal directories.