Documentation ¶
Index ¶
- Constants
- Variables
- func MatchVersionOrRef[T any](vr VersionOrRef, v func(v Version) T, r func(r Ref) T) (_ T)
- func UnwrapValues[T any](l []*Value[T]) []T
- type Query
- type QueryMatch
- type Ref
- type Refs
- type Value
- func (v *Value[T]) AddRefs(refs ...Ref)
- func (v *Value[T]) Clone() *Value[T]
- func (v *Value[T]) DeleteRefs(refs ...Ref)
- func (v Value[T]) Parents() Versions
- func (v Value[T]) Ref() *Value[T]
- func (v Value[T]) Refs() Refs
- func (v Value[T]) Time() time.Time
- func (v Value[T]) Value() T
- func (v Value[T]) Version() Version
- type Values
- func (v *Values[V]) Add(value V, parent *VersionOrRef)
- func (v *Values[V]) All() []*Value[V]
- func (v *Values[V]) Clone() *Values[V]
- func (v *Values[V]) Get(vr VersionOrRef) *Value[V]
- func (v *Values[V]) IsArchived() bool
- func (v *Values[V]) IsEmpty() bool
- func (v *Values[V]) Latest() *Value[V]
- func (v *Values[V]) LatestVersion() *Version
- func (v *Values[V]) SetArchived(archived bool) *Values[V]
- func (v *Values[V]) UpdateRef(r Ref, vr *VersionOrRef)
- type Version
- type VersionOrRef
- type Versions
Constants ¶
View Source
const Latest = Ref("latest")
View Source
const Public = Ref("public")
Variables ¶
View Source
var ErrArchived = rerror.NewE(i18n.T("archived"))
Functions ¶
func MatchVersionOrRef ¶
func MatchVersionOrRef[T any](vr VersionOrRef, v func(v Version) T, r func(r Ref) T) (_ T)
func UnwrapValues ¶
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func Eq ¶
func Eq(vr VersionOrRef) Query
func (Query) Match ¶
func (q Query) Match(m QueryMatch)
type QueryMatch ¶
type QueryMatch struct { All func() Eq func(VersionOrRef) }
type Value ¶
type Value[T any] struct { // contains filtered or unexported fields }
func MustBeValue ¶
func (*Value[T]) DeleteRefs ¶
type Values ¶
type Values[T any] struct { // contains filtered or unexported fields }
func MustBeValues ¶
func (*Values[V]) Add ¶
func (v *Values[V]) Add(value V, parent *VersionOrRef)
func (*Values[V]) Get ¶
func (v *Values[V]) Get(vr VersionOrRef) *Value[V]
func (*Values[V]) IsArchived ¶
func (*Values[V]) LatestVersion ¶
func (*Values[V]) SetArchived ¶
func (*Values[V]) UpdateRef ¶
func (v *Values[V]) UpdateRef(r Ref, vr *VersionOrRef)
type VersionOrRef ¶
type VersionOrRef struct {
// contains filtered or unexported fields
}
func ToVersionOrLatestRef ¶
func ToVersionOrLatestRef(ver *string) VersionOrRef
func (VersionOrRef) IsRef ¶
func (vr VersionOrRef) IsRef(ref Ref) bool
func (VersionOrRef) IsSpecialRef ¶
func (vr VersionOrRef) IsSpecialRef() bool
func (VersionOrRef) IsZero ¶
func (vr VersionOrRef) IsZero() bool
func (VersionOrRef) Match ¶
func (vr VersionOrRef) Match(v func(v Version), r func(r Ref))
func (VersionOrRef) Ref ¶
func (vr VersionOrRef) Ref() *VersionOrRef
Source Files ¶
Click to show internal directories.
Click to hide internal directories.