Documentation
¶
Index ¶
- type Clone
- type DiskStorageOption
- type MemStore
- type ObjectStorage
- type RAMStorageOption
- type ReferenceType
- type RepositoryConfig
- func NewGitRepositoryConfigWithAccessTokenAuth(url string, accessToken string, referenceType ReferenceType, ...) *RepositoryConfig
- func NewGitRepositoryConfigWithNoAuth(url string, referenceType ReferenceType, referenceName string) *RepositoryConfig
- func NewGitRepositoryConfigWithPasswordAuth(url string, username string, password string, referenceType ReferenceType, ...) *RepositoryConfig
- func NewGitRepositoryConfigWithSSHAuth(url string, sshUsername string, privateKey []byte, ...) *RepositoryConfig
- type SizeLimit
- type StorageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clone ¶
type Clone struct { Config *RepositoryConfig StorageType StorageType StorageOptions interface{} // Either GitDiskStorageOption or GitRAMStorageOption type Repository *gogit.Repository FileSystem billy.Filesystem }
Clone is a struct for local git repository cloned
func NewGitCloneToDisk ¶
func NewGitCloneToDisk(repoConfig *RepositoryConfig, storageOptions *DiskStorageOption) (*Clone, error)
NewGitCloneToDisk creates a clone of a git repository using local disk
func NewGitCloneToRAM ¶
func NewGitCloneToRAM(repoConfig *RepositoryConfig, storageOptions *RAMStorageOption) (*Clone, error)
NewGitCloneToRAM creates a clone of a git repository using RAM
func (*Clone) GetFileSystem ¶
func (clone *Clone) GetFileSystem() billy.Filesystem
GetFileSystem returns filesystem to access the git repository
type DiskStorageOption ¶
type DiskStorageOption struct { // ClonePath is a file path to clone ClonePath string }
DiskStorageOption contains options for DiskStorageType
type MemStore ¶
type MemStore struct { memory.ConfigStorage ObjectStorage memory.ShallowStorage memory.IndexStorage memory.ReferenceStorage memory.ModuleStorage // contains filtered or unexported fields }
MemStore augment the original memory storage implementation to set a size limit
type ObjectStorage ¶
type ObjectStorage struct { // the original implementation memory.ObjectStorage // contains filtered or unexported fields }
ObjectStorage implements github.com/go-git/go-git/v5/plumbing/storer.EncodedObjectStorer
func (*ObjectStorage) SetEncodedObject ¶
func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
SetEncodedObject override the SetEncodedObject implementation from memory.ObjectStorage
type RAMStorageOption ¶
type RAMStorageOption struct { // SizeLimit is a size limit for data in Bytes, 0 for unlimited SizeLimit int64 }
RAMStorageOption contains options for RAMStorageType
type ReferenceType ¶
type ReferenceType string
ReferenceType is a type for reference type of git
const ( // BranchReferenceType is for Branch reference type BranchReferenceType ReferenceType = "branch" // TagReferenceType is for Tag reference type TagReferenceType ReferenceType = "tag" )
type RepositoryConfig ¶
type RepositoryConfig struct { URL string Username string // optional Password string // optional SSHPrivateKey []byte // optional ReferenceType ReferenceType ReferenceName string }
RepositoryConfig is a configuration struct
func NewGitRepositoryConfigWithAccessTokenAuth ¶
func NewGitRepositoryConfigWithAccessTokenAuth(url string, accessToken string, referenceType ReferenceType, referenceName string) *RepositoryConfig
NewGitRepositoryConfigWithAccessTokenAuth creates a git repository config with access token auth
func NewGitRepositoryConfigWithNoAuth ¶
func NewGitRepositoryConfigWithNoAuth(url string, referenceType ReferenceType, referenceName string) *RepositoryConfig
NewGitRepositoryConfigWithNoAuth creates a git repository config with no auth
func NewGitRepositoryConfigWithPasswordAuth ¶
func NewGitRepositoryConfigWithPasswordAuth(url string, username string, password string, referenceType ReferenceType, referenceName string) *RepositoryConfig
NewGitRepositoryConfigWithPasswordAuth creates a git repository config with password auth
func NewGitRepositoryConfigWithSSHAuth ¶
func NewGitRepositoryConfigWithSSHAuth(url string, sshUsername string, privateKey []byte, passwordForPrivateKey string, referenceType ReferenceType, referenceName string) *RepositoryConfig
NewGitRepositoryConfigWithSSHAuth creates a git repository config with ssh auth sshUsername is usually "git", passwordForPrivateKey is oftem empty
type SizeLimit ¶
SizeLimit is a struct that stores size limit and current size of data
func (SizeLimit) ExceeedLimit ¶
ExceeedLimit checks whether limit has been exceeded
func (*SizeLimit) IncrementSize ¶
IncrementSize increment the size counter atmoically
type StorageType ¶
type StorageType string
StorageType is a type for git local storage
const ( // DiskStorageType is a disk storage DiskStorageType StorageType = "disk" // RAMStorageType is a RAM storage RAMStorageType StorageType = "ram" )