Documentation
¶
Index ¶
- Constants
- Variables
- func InitWorkspace(baseDir, repo string) error
- func MakeCommitMetadata(commit *Commit) ([]byte, string)
- func MakeCommitPath(hash string) string
- func MakeObjectPath(hash string) string
- func MakeRefPath(ref string) string
- func MakeTagPath(ref string) string
- func Sha1Sum(content []byte) string
- func Sha1SumFromFile(path string) (string, error)
- type ArtConfig
- func (config *ArtConfig) Get(path string) interface{}
- func (config *ArtConfig) GetString(path string) string
- func (config *ArtConfig) Print()
- func (config *ArtConfig) RepoUrl() string
- func (config *ArtConfig) Save() error
- func (config *ArtConfig) Set(path string, value interface{})
- func (config *ArtConfig) SetRepoUrl(repoUrl string)
- type ArtifactManager
- func (mngr *ArtifactManager) AddRef(ref string, commit string) error
- func (mngr *ArtifactManager) AddTag(refOrCommit, tag string) error
- func (mngr *ArtifactManager) Commit(commit Commit) error
- func (mngr *ArtifactManager) DeleteRef(ref string) error
- func (mngr *ArtifactManager) DeleteTag(tag string) error
- func (mngr *ArtifactManager) Diff(option DiffOptions) (DiffResult, error)
- func (mngr *ArtifactManager) Download(repoPath, localPath, tmpDir string, meter *repository.Meter) error
- func (mngr *ArtifactManager) DownloadBlob(localPath, hash string, meter *repository.Meter) (BlobDownloadResult, error)
- func (mngr *ArtifactManager) Fetch() error
- func (mngr *ArtifactManager) FindCommitOrReference(refOrCommit string) (string, error)
- func (mngr *ArtifactManager) GetCommit(hash string) (*Commit, error)
- func (mngr *ArtifactManager) GetRef(ref string) (string, error)
- func (mngr *ArtifactManager) List(refOrCommit string) error
- func (mngr *ArtifactManager) ListTags() error
- func (mngr *ArtifactManager) Log(refOrCommit string) error
- func (mngr *ArtifactManager) MakeEmptyCommit() *Commit
- func (mngr *ArtifactManager) MakeWorkspaceCommit(parent string, message *string, filter func(path string) bool) (*Commit, error)
- func (mngr *ArtifactManager) Pull(options PullOptions) error
- func (mngr *ArtifactManager) Push(options PushOptions) error
- func (mngr *ArtifactManager) Status() (DiffResult, error)
- func (mngr *ArtifactManager) Upload(localPath, repoPath string, meter *repository.Meter) error
- func (mngr *ArtifactManager) UploadBlob(localPath, hash string, meter *repository.Meter, checkSkip bool) (BlobUploadResult, error)
- type AvcIgnore
- type AvcInclude
- type BlobDownloadResult
- type BlobMetaData
- type BlobUploadResult
- type ChangeMode
- type Commit
- type DiffOptions
- type DiffRecord
- type DiffResult
- type DiffType
- type PathFilter
- type PullOptions
- type PushOptions
- type ReferenceNotFoundError
Constants ¶
View Source
const ( RefLocal = "__local__" RefLatest = "latest" )
Variables ¶
View Source
var ( ErrWorkspaceNotFound = errors.New("not a workspace") ErrEmptyRepository = errors.New("no commit is found in the repository. please push data to repository first") )
Functions ¶
func InitWorkspace ¶
func MakeCommitMetadata ¶
func MakeCommitPath ¶
func MakeObjectPath ¶
func MakeRefPath ¶
func MakeTagPath ¶
func Sha1SumFromFile ¶
Types ¶
type ArtConfig ¶
type ArtConfig struct { MetadataDir string BaseDir string // contains filtered or unexported fields }
func LoadConfig ¶
func (*ArtConfig) SetRepoUrl ¶
type ArtifactManager ¶
type ArtifactManager struct {
// contains filtered or unexported fields
}
func NewArtifactManager ¶
func NewArtifactManager(config ArtConfig) (*ArtifactManager, error)
func (*ArtifactManager) AddRef ¶
func (mngr *ArtifactManager) AddRef(ref string, commit string) error
func (*ArtifactManager) AddTag ¶
func (mngr *ArtifactManager) AddTag(refOrCommit, tag string) error
func (*ArtifactManager) Commit ¶
func (mngr *ArtifactManager) Commit(commit Commit) error
func (*ArtifactManager) DeleteRef ¶
func (mngr *ArtifactManager) DeleteRef(ref string) error
func (*ArtifactManager) DeleteTag ¶
func (mngr *ArtifactManager) DeleteTag(tag string) error
func (*ArtifactManager) Diff ¶
func (mngr *ArtifactManager) Diff(option DiffOptions) (DiffResult, error)
func (*ArtifactManager) Download ¶
func (mngr *ArtifactManager) Download(repoPath, localPath, tmpDir string, meter *repository.Meter) error
func (*ArtifactManager) DownloadBlob ¶
func (mngr *ArtifactManager) DownloadBlob(localPath, hash string, meter *repository.Meter) (BlobDownloadResult, error)
func (*ArtifactManager) Fetch ¶
func (mngr *ArtifactManager) Fetch() error
Fetch downloads all the metadata from repository
func (*ArtifactManager) FindCommitOrReference ¶
func (mngr *ArtifactManager) FindCommitOrReference(refOrCommit string) (string, error)
func (*ArtifactManager) GetCommit ¶
func (mngr *ArtifactManager) GetCommit(hash string) (*Commit, error)
func (*ArtifactManager) List ¶
func (mngr *ArtifactManager) List(refOrCommit string) error
func (*ArtifactManager) ListTags ¶
func (mngr *ArtifactManager) ListTags() error
func (*ArtifactManager) Log ¶
func (mngr *ArtifactManager) Log(refOrCommit string) error
func (*ArtifactManager) MakeEmptyCommit ¶
func (mngr *ArtifactManager) MakeEmptyCommit() *Commit
func (*ArtifactManager) MakeWorkspaceCommit ¶
func (*ArtifactManager) Pull ¶
func (mngr *ArtifactManager) Pull(options PullOptions) error
func (*ArtifactManager) Push ¶
func (mngr *ArtifactManager) Push(options PushOptions) error
func (*ArtifactManager) Status ¶
func (mngr *ArtifactManager) Status() (DiffResult, error)
func (*ArtifactManager) Upload ¶ added in v0.7.0
func (mngr *ArtifactManager) Upload(localPath, repoPath string, meter *repository.Meter) error
func (*ArtifactManager) UploadBlob ¶
func (mngr *ArtifactManager) UploadBlob(localPath, hash string, meter *repository.Meter, checkSkip bool) (BlobUploadResult, error)
type AvcIgnore ¶
func NewAvcIgnore ¶
type AvcInclude ¶
func NewAvcInclude ¶
func NewAvcInclude(filePath []string) *AvcInclude
type BlobDownloadResult ¶
type BlobDownloadResult struct { // File not changed. Skip the download Skip bool }
type BlobMetaData ¶
type BlobMetaData struct { Path string `json:"path"` Hash string `json:"hash,omitempty"` Link string `json:"link,omitempty"` Mode fs.FileMode `json:"mode"` Size int64 `json:"size"` }
func MakeBlobMetadata ¶
func MakeBlobMetadata(baseDir string, path string) (BlobMetaData, error)
type BlobUploadResult ¶
type BlobUploadResult struct { // Blob exists in ther repo. Skip the upload Skip bool }
type ChangeMode ¶
type ChangeMode int
type Commit ¶
type Commit struct { CreatedAt time.Time `json:"createdAt"` Parent string `json:"parent,omitempty"` Message *string `json:"messaage,omitempty"` Blobs []BlobMetaData `json:"blobs"` }
type DiffOptions ¶
type DiffOptions struct { LeftRef string LeftCommit *Commit RightRef string RightCommit *Commit AddFilter PathFilter ChangeFilter PathFilter DeleteFilter PathFilter IncludeFilter PathFilter NoDelete bool }
type DiffRecord ¶
type DiffResult ¶
type DiffResult struct {
Records []DiffRecord
}
func (DiffResult) IsAppendOnly ¶
func (result DiffResult) IsAppendOnly() bool
func (DiffResult) IsChanged ¶
func (result DiffResult) IsChanged() bool
func (*DiffResult) Print ¶
func (result *DiffResult) Print(verbose bool)
type PathFilter ¶
type PullOptions ¶
type PullOptions struct { DryRun bool NoFetch bool Delete bool RefOrCommit *string FileFilter PathFilter }
type PushOptions ¶
type ReferenceNotFoundError ¶
func (ReferenceNotFoundError) Error ¶
func (err ReferenceNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.