Documentation
¶
Index ¶
- type Collection
- func (pgf *Collection) AddFunction(f *Function) error
- func (pgf *Collection) Clone() *Collection
- func (pgf *Collection) DropFunction(funcID id.Function) error
- func (pgf *Collection) GetFunction(funcID id.Function) *Function
- func (pgf *Collection) GetFunctionOverloads(funcID id.Function) []*Function
- func (pgf *Collection) HasFunction(funcID id.Function) bool
- func (pgf *Collection) IterateFunctions(callback func(f *Function) error) error
- func (pgf *Collection) Serialize(ctx context.Context) ([]byte, error)
- type Function
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection contains a collection of functions.
func Deserialize ¶
func Deserialize(ctx context.Context, data []byte) (*Collection, error)
Deserialize returns the Collection that was serialized in the byte slice. Returns an empty Collection if data is nil or empty.
func Merge ¶
func Merge(ctx context.Context, ourCollection, theirCollection, ancCollection *Collection) (*Collection, error)
Merge handles merging functions on our root and their root.
func (*Collection) AddFunction ¶
func (pgf *Collection) AddFunction(f *Function) error
AddFunction adds a new function.
func (*Collection) Clone ¶
func (pgf *Collection) Clone() *Collection
Clone returns a new *Collection with the same contents as the original.
func (*Collection) DropFunction ¶
func (pgf *Collection) DropFunction(funcID id.Function) error
DropFunction drops an existing function.
func (*Collection) GetFunction ¶
func (pgf *Collection) GetFunction(funcID id.Function) *Function
GetFunction returns the function with the given ID. Returns nil if the function cannot be found.
func (*Collection) GetFunctionOverloads ¶
func (pgf *Collection) GetFunctionOverloads(funcID id.Function) []*Function
GetFunctionOverloads returns the overloads for the function matching the schema and the function name. The parameter types are ignored when searching for overloads.
func (*Collection) HasFunction ¶
func (pgf *Collection) HasFunction(funcID id.Function) bool
HasFunction returns whether the function is present.
func (*Collection) IterateFunctions ¶
func (pgf *Collection) IterateFunctions(callback func(f *Function) error) error
IterateFunctions iterates over all functions in the collection.