Documentation
¶
Overview ¶
ds contains data structure implementations that can be reused across other modules.
Index ¶
- type PgEdgeVersion
- func (v *PgEdgeVersion) Clone() *PgEdgeVersion
- func (v *PgEdgeVersion) Compare(other *PgEdgeVersion) int
- func (v *PgEdgeVersion) Equals(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) GreaterThan(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) LessThan(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) String() string
- type Set
- func (s Set[T]) Add(elements ...T)
- func (s Set[T]) Difference(o Set[T]) Set[T]
- func (s Set[T]) Empty() bool
- func (s Set[T]) Equal(o Set[T]) bool
- func (s Set[T]) Has(element T) bool
- func (s Set[T]) Intersection(o Set[T]) Set[T]
- func (s Set[T]) Remove(element T)
- func (s Set[T]) Size() int
- func (s Set[T]) SymmetricDifference(o Set[T]) Set[T]
- func (s Set[T]) ToSlice() []T
- func (s Set[T]) ToSortedSlice(cmp func(a T, b T) int) []T
- func (s Set[T]) Union(o Set[T]) Set[T]
- type Version
- func (v *Version) Clone() *Version
- func (v *Version) Compare(other *Version) int
- func (v *Version) Major() (uint64, bool)
- func (v *Version) MajorString() (string, bool)
- func (v *Version) MajorVersion() *Version
- func (v *Version) MarshalText() (data []byte, err error)
- func (v *Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) error
- func (v *Version) UnmarshalText(data []byte) error
- type VersionConstraint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PgEdgeVersion ¶ added in v0.8.0
type PgEdgeVersion struct {
PostgresVersion *Version `json:"postgres_version"`
SpockVersion *Version `json:"spock_version"`
}
func MustPgEdgeVersion ¶ added in v0.8.0
func MustPgEdgeVersion(postgresVersion, spockVersion string) *PgEdgeVersion
func NewPgEdgeVersion ¶ added in v0.8.0
func NewPgEdgeVersion(postgresVersion, spockVersion string) (*PgEdgeVersion, error)
func (*PgEdgeVersion) Clone ¶ added in v0.8.0
func (v *PgEdgeVersion) Clone() *PgEdgeVersion
func (*PgEdgeVersion) Compare ¶ added in v0.8.0
func (v *PgEdgeVersion) Compare(other *PgEdgeVersion) int
func (*PgEdgeVersion) Equals ¶ added in v0.8.0
func (v *PgEdgeVersion) Equals(other *PgEdgeVersion) bool
func (*PgEdgeVersion) GreaterThan ¶ added in v0.8.0
func (v *PgEdgeVersion) GreaterThan(other *PgEdgeVersion) bool
func (*PgEdgeVersion) LessThan ¶ added in v0.8.0
func (v *PgEdgeVersion) LessThan(other *PgEdgeVersion) bool
func (*PgEdgeVersion) String ¶ added in v0.8.0
func (v *PgEdgeVersion) String() string
type Set ¶
type Set[T comparable] map[T]bool
Set is a generic set type.
func NewSet ¶
func NewSet[T comparable](elements ...T) Set[T]
func SetDifference ¶
func SetDifference[T comparable](a, b []T) Set[T]
SetDifference (a-b) returns the set of elements that are in a, but not b.
func SetSymmetricDifference ¶ added in v0.7.0
func SetSymmetricDifference[T comparable](a, b []T) Set[T]
SetSymmetricDifference (a-b)∪(b-a) returns the set of elements that are in either a or b, but not both.
func (Set[T]) Difference ¶
Difference (s-o) returns elements that are in the receiver set, but not the given set 'o'.
func (Set[T]) Intersection ¶
Intersection (s∩o) returns elements that are in both sets.
func (Set[T]) SymmetricDifference ¶
SymmetricDifference (s-o)∪(o-s) returns elements that are in the receiver set, but not the given set 'o', along with those that are in 'o', but not the receiver set.
func (Set[T]) ToSlice ¶
func (s Set[T]) ToSlice() []T
ToSlice returns a slice of all the elements in the set.
func (Set[T]) ToSortedSlice ¶
ToSortedSlice returns a sorted slice of all the elements in the set.
type Version ¶ added in v0.8.0
type Version struct {
Components []uint64 `json:"components"`
}
func MustParseVersion ¶ added in v0.8.0
func ParseVersion ¶ added in v0.8.0
func (*Version) MajorString ¶ added in v0.8.0
func (*Version) MajorVersion ¶ added in v0.8.0
func (*Version) MarshalText ¶ added in v0.8.0
func (*Version) UnmarshalJSON ¶ added in v0.8.0
func (*Version) UnmarshalText ¶ added in v0.8.0
type VersionConstraint ¶ added in v0.8.0
type VersionConstraint struct {
Min *Version `json:"min,omitempty"`
Max *Version `json:"max,omitempty"`
}
VersionConstraint defines an optional minimum and/or maximum version bound. A nil Min or Max means no restriction on that end of the range.
func (*VersionConstraint) IsSatisfied ¶ added in v0.8.0
func (c *VersionConstraint) IsSatisfied(v *Version) bool
IsSatisfied returns true if v falls within the constraint's bounds.
func (*VersionConstraint) String ¶ added in v0.8.0
func (c *VersionConstraint) String() string