Documentation ¶
Overview ¶
Package entity contains the base common code to define an entity stored in a chain of git objects, supporting actions like Push, Pull and Merge.
Index ¶
Constants ¶
View Source
const IdLengthSHA1 = 40
View Source
const IdLengthSHA256 = 64
View Source
const UnsetId = Id("unset")
Variables ¶
This section is empty.
Functions ¶
func IsErrMultipleMatch ¶
Types ¶
type Alphabetical ¶
type Alphabetical []Id
func (Alphabetical) Len ¶
func (a Alphabetical) Len() int
func (Alphabetical) Less ¶
func (a Alphabetical) Less(i, j int) bool
func (Alphabetical) Swap ¶
func (a Alphabetical) Swap(i, j int)
type ErrMultipleMatch ¶
type ErrMultipleMatch struct { Matching []Id // contains filtered or unexported fields }
func NewErrMultipleMatch ¶
func NewErrMultipleMatch(entityType string, matching []Id) *ErrMultipleMatch
func (ErrMultipleMatch) Error ¶
func (e ErrMultipleMatch) Error() string
type Id ¶
type Id string
Id is an identifier for an entity or part of an entity
func (Id) MarshalGQL ¶
MarshalGQL implement the Marshaler interface for gqlgen
func (*Id) UnmarshalGQL ¶
UnmarshalGQL implement the Unmarshaler interface for gqlgen
type MergeResult ¶
type MergeResult struct { // Err is set when a terminal error occur in the process Err error Id Id Status MergeStatus // Only set for invalid status Reason string // Not set for invalid status Entity Interface }
func NewMergeError ¶
func NewMergeError(err error, id Id) MergeResult
func NewMergeInvalidStatus ¶
func NewMergeInvalidStatus(id Id, reason string) MergeResult
func NewMergeStatus ¶
func NewMergeStatus(status MergeStatus, id Id, entity Interface) MergeResult
func (MergeResult) String ¶
func (mr MergeResult) String() string
type MergeStatus ¶
type MergeStatus int
MergeStatus represent the result of a merge operation of an entity
const ( MergeStatusNew MergeStatus MergeStatusInvalid MergeStatusUpdated MergeStatusNothing MergeStatusError )
Click to show internal directories.
Click to hide internal directories.