Documentation ¶
Index ¶
- Variables
- func FindScpLikeComponents(url string) (user, host, port, path string)
- func IsLocalEndpoint(url string) bool
- func IsRemoteEndpoint(url string) bool
- func MatchesScheme(url string) bool
- func MatchesScpLike(url string) bool
- type BatchRequest
- type BatchResponse
- type BatchSharedsRequest
- type BatchSharedsResponse
- type Command
- type Endpoint
- type HaveObject
- type MetadataOptions
- type Operation
- type Options
- type Reference
- type Representation
- type SASHandeshake
- type SASPayload
- type SessionReader
- type SizeReader
- type Transport
- type WantObject
Constants ¶
This section is empty.
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 IsLocalEndpoint ¶
IsLocalEndpoint returns true if the given URL string specifies a local file endpoint. For example, on a Linux machine, `/home/user/src/go-git` would match as a local endpoint, but `https://github.com/src-d/go-git` would not.
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.
Types ¶
type BatchRequest ¶
type BatchRequest struct {
Objects []*HaveObject `json:"objects"`
}
type BatchResponse ¶
type BatchResponse struct {
Objects []*HaveObject `json:"objects"`
}
type BatchSharedsRequest ¶
type BatchSharedsRequest struct {
}type BatchSharedsResponse ¶
type BatchSharedsResponse struct {
}type Endpoint ¶
type Endpoint struct { // Protocol is the protocol of the endpoint (e.g. git, https, file). Protocol string // User is the user. User string // Password is the password. Password string // Host is the host. Host string // Port is the port to connect, if 0 the default port for the given protocol // wil be used. Port int // Path is the repository path. Path string // Base URL only http/https Base *url.URL // InsecureSkipTLS skips ssl verify if protocol is https InsecureSkipTLS bool // ExtraHeader extra header ExtraHeader map[string]string }
Endpoint represents a Git 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,omitempty"` }
func (*Representation) Copy ¶
func (r *Representation) Copy() *Representation
func (*Representation) IsExpired ¶
func (r *Representation) IsExpired() bool
type SASHandeshake ¶
type SASPayload ¶
type SASPayload struct { Header map[string]string `json:"header,omitempty"` Notice string `json:"notice,omitempty"` ExpiresAt time.Time `json:"expires_at,omitempty"` }
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 sparses metadata. // target: commit or tag FetchMetadata(ctx context.Context, target plumbing.Hash, opts *MetadataOptions) (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) Shared(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.