datasource

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource interface {
	Fields() map[string]Field
	Find(ctx QueryContext) (*ListResult, error)
	FindOne(ctx QueryContext) (*map[string]interface{}, error)
	Create(ctx QueryContext, data interface{}) (*map[string]interface{}, error)
	Update(ctx QueryContext, data interface{}) (ManyAffectedResult, error)
	Destroy(ctx QueryContext) (ManyAffectedResult, error)
}

type Field

type Field struct {
	Name     string
	Type     string
	Nullable bool
}

type ListResult

type ListResult struct {
	Data  []map[string]interface{}
	Count int64
}

type ManyAffectedResult

type ManyAffectedResult struct {
	TotalAffected int64
}

type Properties

type Properties struct {
	Skip  int64
	Limit int64
}

func (*Properties) GetLimit

func (d *Properties) GetLimit(ctx QueryContext) int64

func (*Properties) GetSkip

func (d *Properties) GetSkip(ctx QueryContext) int64

type QueryContext

type QueryContext struct {
	context.Context
	Filter *filter.Filter
}

type SingleResult

type SingleResult map[string]interface{}

Directories

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

Jump to

Keyboard shortcuts

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