gitrekt

package
v0.0.0-...-b56bb17 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitPayloadAddFile    = 1
	CommitPayloadModifyFile = 2
	CommitPayloadDeleteFile = 3
)
View Source
const (
	QuarantineReasonAuthTimeout  QuarantineReason = "auth-timeout"
	QuarantineReasonCloneTimeout                  = "clone-timeout"
	QuarantineReasonNotFound                      = "not-found"
	QuarantineReasonUnknown                       = "unknown"
)

Variables

This section is empty.

Functions

func ListChangedFiles

func ListChangedFiles(repo *Repository, base Revision, head Revision, comparison ListChangedFilesComparisonType) ([]string, error)

func UpdateOrClone

func UpdateOrClone(repo *Repository, revision *Revision) (string, error)

Types

type AuthFailedError

type AuthFailedError struct {
	Output string
}

func (*AuthFailedError) Error

func (e *AuthFailedError) Error() string

type CommitOperation

type CommitOperation struct {
	Repository *Repository
	Payload    CommitPayload
	// contains filtered or unexported fields
}

func NewCommitOperation

func NewCommitOperation(repo *Repository, payload CommitPayload) *CommitOperation

func (*CommitOperation) Run

func (op *CommitOperation) Run() (*Revision, error)

func (*CommitOperation) Validate

func (op *CommitOperation) Validate() error

type CommitPayload

type CommitPayload struct {
	CommitMessage string
	CommiterName  string
	CommiterEmail string
	Changes       []CommitPayloadChange
	BranchName    string
}

type CommitPayloadAction

type CommitPayloadAction int

type CommitPayloadChange

type CommitPayloadChange struct {
	Path    string
	Content string
	Action  CommitPayloadAction
}

type Credentials

type Credentials struct {
	Username string
	Password string
}

type File

type File struct {
	Path    string
	Content string
}
func Search(repo *Repository, rev Revision, options *SearchOptions) ([]*File, error)

type ListChangedFilesComparisonType

type ListChangedFilesComparisonType int
const (
	ListChangedFilesComparisonTypeHeadToHead      ListChangedFilesComparisonType = 0
	ListChangedFilesComparisonTypeHeadToMergeBase ListChangedFilesComparisonType = 1
)

type Lock

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

type NotFoundError

type NotFoundError struct {
	Output string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type QuarantineReason

type QuarantineReason string

type QuarantineStats

type QuarantineStats struct {
	QuarantineReasonAuthTimeout  int
	QuarantineReasonCloneTimeout int
	QuarantineReasonNotFound     int
	QuarantineReasonUnknown      int
}

func GetQuarantineStats

func GetQuarantineStats() (*QuarantineStats, error)

type RemoteCallbacks

type RemoteCallbacks struct {
	Started        time.Time
	Repository     *Repository
	AuthRetries    int
	MaxAuthRetries int
	MaxDuration    time.Duration

	HasAuthTimeouted     bool
	HasProgressTimeouted bool
}

type Repository

type Repository struct {
	Name        string
	HttpURL     string
	Credentials *Credentials
}

func (*Repository) AcquireLock

func (r *Repository) AcquireLock() *Lock

func (*Repository) Exists

func (r *Repository) Exists() bool

func (*Repository) IsLocked

func (r *Repository) IsLocked() bool

func (*Repository) IsQuarantined

func (r *Repository) IsQuarantined() bool

func (*Repository) LockPath

func (r *Repository) LockPath() string

func (*Repository) Path

func (r *Repository) Path() string

func (*Repository) PutInQuarantine

func (r *Repository) PutInQuarantine(reason QuarantineReason) error

func (*Repository) QuarantinePath

func (r *Repository) QuarantinePath() string

func (*Repository) ReleaseLock

func (r *Repository) ReleaseLock(l *Lock)

type Revision

type Revision struct {
	CommitSha string
	Reference string
}

func Commit

func Commit(repo *Repository, payload CommitPayload) (rev *Revision, err error)

type SearchOptions

type SearchOptions struct {
	Selectors      []SearchOptionsSelectors
	IncludeContent bool
}

func (*SearchOptions) Matches

func (o *SearchOptions) Matches(repo *git.Repository, dir string, e *git.TreeEntry) bool

type SearchOptionsSelectors

type SearchOptionsSelectors struct {
	Glob         string
	ContentRegex *regexp.Regexp
}

func (*SearchOptionsSelectors) Matches

func (s *SearchOptionsSelectors) Matches(repo *git.Repository, dir string, e *git.TreeEntry) bool

type Stats

type Stats struct {
	TotalRepositoryCount  int
	TotalLockfileCount    int
	TotalQuarantinedCount int
	TotalUnknownCount     int
}

func GetStats

func GetStats() (*Stats, error)

type TimeoutError

type TimeoutError struct {
	Output string
}

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type UpdateOrCloneOperation

type UpdateOrCloneOperation struct {
	Repository *Repository
	Reference  string
	Started    time.Time
	Finished   time.Time
}

func NewUpdateOrCloneOperation

func NewUpdateOrCloneOperation(repo *Repository, reference string) *UpdateOrCloneOperation

func (*UpdateOrCloneOperation) Clone

func (o *UpdateOrCloneOperation) Clone() error

func (*UpdateOrCloneOperation) Duration

func (o *UpdateOrCloneOperation) Duration() float64

func (*UpdateOrCloneOperation) Run

func (o *UpdateOrCloneOperation) Run() error

func (*UpdateOrCloneOperation) Update

func (o *UpdateOrCloneOperation) Update() error

Jump to

Keyboard shortcuts

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