librepository

package
v0.0.0-...-ec57856 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateInterface

type AggregateInterface interface {
	Definition() *Definition
	SetRepository(*libdomain.RepositoryInterface)
}

Definition is used to declare the information of a model, so it can generate its code.

type CacheClient

type CacheClient interface {
	SetCache(string, []byte) error
	GetCache(string) ([]byte, error)
	InvalidateCache(string) bool
	SetRecordCache(string, string, string, []byte) error
	GetRecordCache(string, string, string) ([]byte, error)
	InvalidateRecordCache(string, string, string) bool
}

type DatasourceClient

type DatasourceClient interface {
	MigrateAggregate(*libdomain.AggregateDefinition) error
	InitDB(writeInfo *libdata.ClusterInfo, readInfo *libdata.ClusterInfo) (*libdata.Cluster, error)
	CreateTenant(*libdata.Workflow, []*libdata.ModelDefinition, *libdata.Tenant) error
	GetTenant(*libdata.Workflow, *libdata.Tenant) (*libdata.Tenant, error)
	GetImportRepository() string
	GenerateScanFunc(libdomain.TableInterface) string
	Get(*libdomain.EntityDefinition, *libapplication.Workflow, string) (interface{}, error)
	Select(libdomain.TableInterface, *libapplication.Workflow, *basepb.ListQuery) (interface{}, error)
	Insert(
		libdomain.TableInterface, *libapplication.Workflow, []interface{},
		func([]interface{}) ([]string, map[string]interface{}),
	) (interface{}, error)
	Update(
		libdomain.TableInterface, *libapplication.Workflow, []*basepb.Where, interface{}, *fieldmask.FieldMask,
		func(interface{}, *fieldmask.FieldMask) ([]string, map[string]interface{}),
	) (interface{}, error)
	Delete(libdomain.TableInterface, *libapplication.Workflow, []*basepb.Where) error
	BeginTransaction(*libapplication.Workflow, bool) error
	RollbackTransaction(*libapplication.Workflow) error
	CommitTransaction(*libapplication.Workflow) error
}

Driver is an interface for the drivers providing crud operations.

type Definition

type Definition struct {
	Aggregate        libdomain.AggregateInterface
	DatasourceClient DatasourceClient
	CacheClient      CacheClient
	GenDomain        string
}

Definition is used to declare the information of a model, so it can generate its code.

type Definitions

type Definitions struct {
	Prefix        string
	GitRepository string
	// contains filtered or unexported fields
}

Definitions contains all the grpc definitions in the service.

func (*Definitions) GetByID

func (ds *Definitions) GetByID(id string) *Definition

GetByID return the specified definition by its ID.

func (*Definitions) MigrateAggregates

func (ds *Definitions) MigrateAggregates() error

GetByID return the specified definition by its ID.

func (*Definitions) Register

func (ds *Definitions) Register(d *Definition)

Register is used to register a new definition into the service.

func (*Definitions) Slice

func (ds *Definitions) Slice() []*Definition

Slice return the definitions as a slice.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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