metadata

package
v0.0.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEntityOpt added in v0.0.2

type CreateEntityOpt struct {
	types.CreateEntityOpt
}

Create

type CreateFeatureOpt

type CreateFeatureOpt struct {
	FeatureName string
	GroupID     int
	DBValueType string
	Description string
	ValueType   string
}

type CreateGroupOpt added in v0.0.3

type CreateGroupOpt struct {
	GroupName   string
	EntityID    int
	Description string
	Category    string
}

type CreateRevisionOpt

type CreateRevisionOpt struct {
	Revision    int64
	GroupID     int
	DataTable   *string
	Anchored    bool
	Description string
}

type ListFeatureOpt added in v0.0.2

type ListFeatureOpt struct {
	EntityID     *int
	GroupID      *int
	FeatureIDs   *[]int
	FeatureNames *[]string
}

type ReadStore added in v0.0.3

type ReadStore interface {
	GetEntity(ctx context.Context, id int) (*types.Entity, error)
	GetEntityByName(ctx context.Context, name string) (*types.Entity, error)
	ListEntity(ctx context.Context) types.EntityList

	GetFeature(ctx context.Context, id int) (*types.Feature, error)
	GetFeatureByName(ctx context.Context, name string) (*types.Feature, error)
	ListFeature(ctx context.Context, opt ListFeatureOpt) types.FeatureList

	GetGroup(ctx context.Context, id int) (*types.Group, error)
	GetGroupByName(ctx context.Context, name string) (*types.Group, error)
	ListGroup(ctx context.Context, entityID *int) types.GroupList

	GetRevision(ctx context.Context, id int) (*types.Revision, error)
	GetRevisionBy(ctx context.Context, groupID int, revision int64) (*types.Revision, error)
	ListRevision(ctx context.Context, groupID *int) types.RevisionList

	// refresh
	Refresh() error
}

type RevisionRange added in v0.0.2

type RevisionRange struct {
	MinRevision int64  `db:"min_revision"`
	MaxRevision int64  `db:"max_revision"`
	DataTable   string `db:"data_table"`
}

type SqlxContext added in v0.0.2

type SqlxContext interface {
	GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

	DriverName() string
	Rebind(string) string
}

type Store

type Store interface {
	ReadStore
	WriteStore

	io.Closer
}

type UpdateEntityOpt added in v0.0.2

type UpdateEntityOpt struct {
	EntityID       int
	NewDescription string
}

Update

type UpdateFeatureOpt added in v0.0.2

type UpdateFeatureOpt struct {
	FeatureID      int
	NewDescription string
}

type UpdateGroupOpt added in v0.0.3

type UpdateGroupOpt struct {
	GroupID             int
	NewDescription      *string
	NewOnlineRevisionID *int
}

type UpdateRevisionOpt added in v0.0.2

type UpdateRevisionOpt struct {
	RevisionID  int
	NewRevision *int64
	NewAnchored *bool
}

type WriteStore added in v0.0.3

type WriteStore interface {
	// entity
	CreateEntity(ctx context.Context, opt CreateEntityOpt) (int, error)
	UpdateEntity(ctx context.Context, opt UpdateEntityOpt) error

	// feature
	CreateFeature(ctx context.Context, opt CreateFeatureOpt) (int, error)
	UpdateFeature(ctx context.Context, opt UpdateFeatureOpt) error

	// feature group
	CreateGroup(ctx context.Context, opt CreateGroupOpt) (int, error)
	UpdateGroup(ctx context.Context, opt UpdateGroupOpt) error

	// revision
	CreateRevision(ctx context.Context, opt CreateRevisionOpt) (int, string, error)
	UpdateRevision(ctx context.Context, opt UpdateRevisionOpt) error

	// transaction
	WithTransaction(ctx context.Context, fn func(context.Context, WriteStore) error) error
}

Directories

Path Synopsis
Package mock_metadata is a generated GoMock package.
Package mock_metadata is a generated GoMock package.

Jump to

Keyboard shortcuts

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