commands

package
v0.0.0-...-ed5212a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const COMMIT_EXTENSION_DEPTH_MAX = 9

Variables

View Source
var (
	RootCmd = &cobra.Command{
		Use: "arciv",
		Run: func(cmd *cobra.Command, args []string) {
			cmd.Usage()
		},
	}
)
View Source
var RunningFromLatestRequestOption bool
View Source
var RunningFromRequestOption string

Functions

func Exit

func Exit(err error, codes ...int)

func Run

func Run()

Types

type Commit

type Commit struct {
	Id        string
	Timestamp int64
	Hash      Hash
	Tags      []Tag
	Depth     int // memo chained commit depth. use in #arciv-commit-extension
}

type FileOp

type FileOp struct {
	// contains filtered or unexported fields
}

type FindField

type FindField int
const (
	FIND_PATH      FindField = 0x001
	FIND_HASH      FindField = 0x010
	FIND_TIMESTAMP FindField = 0x100
)

type Hash

type Hash []byte

func (Hash) String

func (hash Hash) String() string

type Repository

type Repository struct {
	Name     string
	Location RepositoryLocation
}

func SelfRepo

func SelfRepo() Repository

func (Repository) AddCommit

func (repository Repository) AddCommit(commit Commit) error

func (Repository) FetchBlobHashes

func (repository Repository) FetchBlobHashes() (blobs []string, err error)

func (Repository) Init

func (r Repository) Init() error

func (Repository) LoadCommit

func (repository Repository) LoadCommit(commitId string) (Commit, error)

func (Repository) LoadCommitFromAlias

func (repository Repository) LoadCommitFromAlias(alias string) (Commit, error)

func (Repository) LoadLatestCommit

func (repository Repository) LoadLatestCommit() (Commit, error)

func (Repository) LoadLatestCommitId

func (repository Repository) LoadLatestCommitId() (string, error)

func (Repository) LoadRestoreRequest

func (r Repository) LoadRestoreRequest(restoreRequestAlias string) (restoreRequestId string, restoreRequest RestoreRequest, err error)

func (Repository) LoadTags

func (repository Repository) LoadTags(commitId string) (tags []Tag, depth int, err error)

func (Repository) LoadTimeline

func (repository Repository) LoadTimeline() ([]string, error)

func (Repository) LoadTimestamps

func (repository Repository) LoadTimestamps(commitId string) ([]Tag, error)

func (Repository) ReceiveRemoteBlobs

func (repository Repository) ReceiveRemoteBlobs(tags []Tag) (err error)

receive to .arciv/blob

func (Repository) ReceiveRemoteBlobsRequest

func (r Repository) ReceiveRemoteBlobsRequest(tags []Tag, validDays int32) (blobsRequested []string, err error)

func (Repository) SendLocalBlobs

func (repository Repository) SendLocalBlobs(tags []Tag) (err error)

send from repository's root directory

func (Repository) String

func (repository Repository) String() string

func (Repository) WriteRestoreRequest

func (r Repository) WriteRestoreRequest(restoreRequestId string, restoreRequest RestoreRequest) error

func (Repository) WriteTags

func (repository Repository) WriteTags(commit Commit, base *Commit) error

func (Repository) WriteTimeline

func (repository Repository) WriteTimeline(timeline []string) error

type RepositoryLocation

type RepositoryLocation interface {
	String() string

	SendLocalBlobs([]Tag) error
	ReceiveRemoteBlobs([]Tag) error
	// contains filtered or unexported methods
}

type RepositoryLocationFile

type RepositoryLocationFile struct {
	Path string
}

func (RepositoryLocationFile) ReceiveRemoteBlobs

func (repositoryLocationFile RepositoryLocationFile) ReceiveRemoteBlobs(tags []Tag) (err error)

func (RepositoryLocationFile) SendLocalBlobs

func (repositoryLocationFile RepositoryLocationFile) SendLocalBlobs(tags []Tag) (err error)

func (RepositoryLocationFile) String

func (r RepositoryLocationFile) String() string

type RepositoryLocationS3

type RepositoryLocationS3 struct {
	BucketName string
	RegionName string
}

func (RepositoryLocationS3) ReceiveRemoteBlobs

func (r RepositoryLocationS3) ReceiveRemoteBlobs(tags []Tag) (err error)

func (RepositoryLocationS3) ReceiveRemoteBlobsRequest

func (r RepositoryLocationS3) ReceiveRemoteBlobsRequest(tags []Tag, validDays int32) (blobsRequested []string, err error)

func (RepositoryLocationS3) SendLocalBlobs

func (r RepositoryLocationS3) SendLocalBlobs(tags []Tag) (err error)

func (RepositoryLocationS3) String

func (r RepositoryLocationS3) String() string

type RestoreRequest

type RestoreRequest struct {
	Repository Repository
	ValidDays  int32
	Commit     Commit
	Blobs      []string
}

func (RestoreRequest) String

func (r RestoreRequest) String() (str string)

func (RestoreRequest) Strings

func (r RestoreRequest) Strings() []string

type S3BucketClient

type S3BucketClient struct {
	S3client   *s3.Client
	BucketName string
	RegionName string
}

type S3Op

type S3Op struct {
	// contains filtered or unexported fields
}

type Tag

type Tag struct {
	Path          string
	Hash          Hash
	Timestamp     int64
	UsedTimestamp bool
	UsedHash      bool
}

func (Tag) String

func (tag Tag) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL