typecollection

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeCollection

type TypeCollection struct {
	// contains filtered or unexported fields
}

TypeCollection contains a collection of Types.

func Deserialize

func Deserialize(ctx context.Context, data []byte) (*TypeCollection, 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 *TypeCollection) (*TypeCollection, error)

Merge handles merging sequences on our root and their root.

func (*TypeCollection) Clone

func (pgs *TypeCollection) Clone() *TypeCollection

Clone returns a new *TypeCollection with the same contents as the original.

func (*TypeCollection) CreateType

func (pgs *TypeCollection) CreateType(schema string, typ *types.Type) error

CreateType creates a new Type.

func (*TypeCollection) DropType

func (pgs *TypeCollection) DropType(schName, typName string) error

DropType drops an existing Type.

func (*TypeCollection) GetAllTypes

func (pgs *TypeCollection) GetAllTypes() (typesMap map[string][]*types.Type, schemaNames []string, totalCount int)

GetAllTypes returns a map containing all types in the collection, grouped by the schema they're contained in. Each type array is also sorted by the type name.

func (*TypeCollection) GetDomainType

func (pgs *TypeCollection) GetDomainType(schName, typName string) (*types.Type, bool)

GetDomainType returns a domain Type with the given schema and name. Returns nil if the Type cannot be found. It checks for type of Type for domain type.

func (*TypeCollection) GetType

func (pgs *TypeCollection) GetType(schName, typName string) (*types.Type, bool)

GetType returns the Type with the given schema and name. Returns nil if the Type cannot be found.

func (*TypeCollection) IterateTypes

func (pgs *TypeCollection) IterateTypes(f func(schema string, typ *types.Type) error) error

IterateTypes iterates over all Types in the collection.

func (*TypeCollection) Serialize

func (pgs *TypeCollection) Serialize(ctx context.Context) ([]byte, error)

Serialize returns the TypeCollection as a byte slice. If the TypeCollection is nil, then this returns a nil slice.

Jump to

Keyboard shortcuts

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