ds

package
v0.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: PostgreSQL Imports: 7 Imported by: 0

Documentation

Overview

ds contains data structure implementations that can be reused across other modules.

Index

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]) Add

func (s Set[T]) Add(elements ...T)

Add adds an element to the set.

func (Set[T]) Difference

func (s Set[T]) Difference(o Set[T]) Set[T]

Difference (s-o) returns elements that are in the receiver set, but not the given set 'o'.

func (Set[T]) Empty

func (s Set[T]) Empty() bool

Empty returns whether the set is empty.

func (Set[T]) Equal

func (s Set[T]) Equal(o Set[T]) bool

Equal returns whether the given set is equal to the receiver set.

func (Set[T]) Has

func (s Set[T]) Has(element T) bool

Has returns true if the given element is in the set.

func (Set[T]) Intersection

func (s Set[T]) Intersection(o Set[T]) Set[T]

Intersection (s∩o) returns elements that are in both sets.

func (Set[T]) Remove

func (s Set[T]) Remove(element T)

Remove removes an element to the set.

func (Set[T]) Size

func (s Set[T]) Size() int

Size returns the number of elements in the set.

func (Set[T]) SymmetricDifference

func (s Set[T]) SymmetricDifference(o Set[T]) Set[T]

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

func (s Set[T]) ToSortedSlice(cmp func(a T, b T) int) []T

ToSortedSlice returns a sorted slice of all the elements in the set.

func (Set[T]) Union

func (s Set[T]) Union(o Set[T]) Set[T]

Union (s∪o) returns all elements from both sets.

type Version added in v0.8.0

type Version struct {
	Components []uint64 `json:"components"`
}

func MustParseVersion added in v0.8.0

func MustParseVersion(s string) *Version

func ParseVersion added in v0.8.0

func ParseVersion(s string) (*Version, error)

func (*Version) Clone added in v0.8.0

func (v *Version) Clone() *Version

func (*Version) Compare added in v0.8.0

func (v *Version) Compare(other *Version) int

func (*Version) Major added in v0.8.0

func (v *Version) Major() (uint64, bool)

func (*Version) MajorString added in v0.8.0

func (v *Version) MajorString() (string, bool)

func (*Version) MajorVersion added in v0.8.0

func (v *Version) MajorVersion() *Version

func (*Version) MarshalText added in v0.8.0

func (v *Version) MarshalText() (data []byte, err error)

func (*Version) String added in v0.8.0

func (v *Version) String() string

func (*Version) UnmarshalJSON added in v0.8.0

func (v *Version) UnmarshalJSON(data []byte) error

func (*Version) UnmarshalText added in v0.8.0

func (v *Version) UnmarshalText(data []byte) error

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

Jump to

Keyboard shortcuts

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