Documentation ¶
Overview ¶
Package examples contains a couple of examples of generated peds collections
Index ¶
- type IntVector
- func (v *IntVector) Append(item ...int) *IntVector
- func (v *IntVector) Get(i int) int
- func (v *IntVector) Len() int
- func (v *IntVector) Range(f func(int) bool)
- func (v *IntVector) Set(i int, item int) *IntVector
- func (v *IntVector) Slice(start, stop int) *IntVectorSlice
- func (v *IntVector) ToNativeSlice() []int
- type IntVectorSlice
- func (s *IntVectorSlice) Append(items ...int) *IntVectorSlice
- func (s *IntVectorSlice) Get(i int) int
- func (s *IntVectorSlice) Len() int
- func (s *IntVectorSlice) Range(f func(int) bool)
- func (s *IntVectorSlice) Set(i int, item int) *IntVectorSlice
- func (s *IntVectorSlice) Slice(start, stop int) *IntVectorSlice
- type Person
- type PersonBySsn
- func (m *PersonBySsn) Delete(key string) *PersonBySsn
- func (m *PersonBySsn) Len() int
- func (m *PersonBySsn) Load(key string) (value Person, ok bool)
- func (m *PersonBySsn) Range(f func(string, Person) bool)
- func (m *PersonBySsn) Store(key string, value Person) *PersonBySsn
- func (m *PersonBySsn) ToNativeMap() map[string]Person
- type PersonBySsnItem
- type Persons
- func (s *Persons) Add(item Person) *Persons
- func (s *Persons) Contains(item Person) bool
- func (s *Persons) Delete(item Person) *Persons
- func (s *Persons) Difference(other *Persons) *Persons
- func (s *Persons) Equals(other *Persons) bool
- func (s *Persons) Intersection(other *Persons) *Persons
- func (s *Persons) IsSubset(other *Persons) bool
- func (s *Persons) IsSuperset(other *Persons) bool
- func (s *Persons) Len() int
- func (s *Persons) Range(f func(Person) bool)
- func (s *Persons) SymmetricDifference(other *Persons) *Persons
- func (s *Persons) ToNativeSlice() []Person
- func (s *Persons) Union(other *Persons) *Persons
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntVector ¶
type IntVector struct {
// contains filtered or unexported fields
}
A IntVector is an ordered persistent/immutable collection of items corresponding roughly to the use cases for a slice.
func NewIntVector ¶
NewIntVector returns a new IntVector containing the items provided in items.
func (*IntVector) Range ¶
Range calls f repeatedly passing it each element in v in order as argument until either all elements have been visited or f returns false.
func (*IntVector) Slice ¶
func (v *IntVector) Slice(start, stop int) *IntVectorSlice
Slice returns a IntVectorSlice that refers to all elements [start,stop) in v.
func (*IntVector) ToNativeSlice ¶
ToNativeSlice returns a Go slice containing all elements of v
type IntVectorSlice ¶
type IntVectorSlice struct {
// contains filtered or unexported fields
}
IntVectorSlice is a slice type backed by a IntVector.
func NewIntVectorSlice ¶
func NewIntVectorSlice(items ...int) *IntVectorSlice
NewIntVectorSlice returns a new NewIntVectorSlice containing the items provided in items.
func (*IntVectorSlice) Append ¶
func (s *IntVectorSlice) Append(items ...int) *IntVectorSlice
Append returns a new slice with item(s) appended to it.
func (*IntVectorSlice) Get ¶
func (s *IntVectorSlice) Get(i int) int
Get returns the element at position i.
func (*IntVectorSlice) Range ¶
func (s *IntVectorSlice) Range(f func(int) bool)
Range calls f repeatedly passing it each element in s in order as argument until either all elements have been visited or f returns false.
func (*IntVectorSlice) Set ¶
func (s *IntVectorSlice) Set(i int, item int) *IntVectorSlice
Set returns a new slice with the element at position i set to item.
func (*IntVectorSlice) Slice ¶
func (s *IntVectorSlice) Slice(start, stop int) *IntVectorSlice
Slice returns a IntVectorSlice that refers to all elements [start,stop) in s.
type Person ¶
type Person struct {
// contains filtered or unexported fields
}
Person is a custom example type that represents a person
type PersonBySsn ¶
type PersonBySsn struct {
// contains filtered or unexported fields
}
PersonBySsn is a persistent key - value map
func NewPersonBySsn ¶
func NewPersonBySsn(items ...PersonBySsnItem) *PersonBySsn
NewPersonBySsn returns a new PersonBySsn containing all items in items.
func NewPersonBySsnFromNativeMap ¶
func NewPersonBySsnFromNativeMap(m map[string]Person) *PersonBySsn
NewPersonBySsnFromNativeMap returns a new PersonBySsn containing all items in m.
func (*PersonBySsn) Delete ¶
func (m *PersonBySsn) Delete(key string) *PersonBySsn
Delete returns a new PersonBySsn without the element identified by key.
func (*PersonBySsn) Load ¶
func (m *PersonBySsn) Load(key string) (value Person, ok bool)
Load returns value identified by key. ok is set to true if key exists in the map, false otherwise.
func (*PersonBySsn) Range ¶
func (m *PersonBySsn) Range(f func(string, Person) bool)
Range calls f repeatedly passing it each key and value as argument until either all elements have been visited or f returns false.
func (*PersonBySsn) Store ¶
func (m *PersonBySsn) Store(key string, value Person) *PersonBySsn
Store returns a new PersonBySsn containing value identified by key.
func (*PersonBySsn) ToNativeMap ¶
func (m *PersonBySsn) ToNativeMap() map[string]Person
ToNativeMap returns a native Go map containing all elements of m.
type PersonBySsnItem ¶
type Persons ¶
type Persons struct {
// contains filtered or unexported fields
}
Persons is a persistent set
func NewPersons ¶
NewPersons returns a new Persons containing items.
func (*Persons) Difference ¶
Difference returns a new Persons containing all elements present in s but not in other.
func (*Persons) Equals ¶
Equals returns true if s and other contains the same elements, false otherwise.
func (*Persons) Intersection ¶
Intersection returns a new Persons containing all elements present in both s and other.
func (*Persons) IsSubset ¶
IsSubset returns true if all elements in s are present in other, false otherwise.
func (*Persons) IsSuperset ¶
IsSuperset returns true if all elements in other are present in s, false otherwise.
func (*Persons) Range ¶
Range calls f repeatedly passing it each element in s as argument until either all elements have been visited or f returns false.
func (*Persons) SymmetricDifference ¶
SymmetricDifference returns a new Persons containing all elements present in either s or other but not both.
func (*Persons) ToNativeSlice ¶
ToNativeSlice returns a native Go slice containing all elements of s.