repo

package
v0.0.0-...-eebf476 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	Reader
	Create() (model.Entity, error)
	Load(Stream)
}

type External

type External struct {
	Store  *sql.DB
	Crates map[int64]*model.External
}

func NewExternal

func NewExternal(store *sql.DB) *External

func (*External) After

func (self *External) After(field string, search time.Time) Stream

func (*External) All

func (self *External) All() Stream

func (*External) Before

func (self *External) Before(field string, search time.Time) Stream

func (*External) Between

func (self *External) Between(
	field string,
	before time.Time,
	after time.Time,
) Stream

func (*External) Contains

func (self *External) Contains(field string, search string) Stream

func (*External) Create

func (self *External) Create() (model.Entity, error)

func (*External) Equals

func (self *External) Equals(field string, search string) Stream

func (*External) Get

func (self *External) Get(id int64) (model.Entity, error)

func (*External) Import

func (self *External) Import(
	id int64,
	uuid []byte,
	added time.Time,
	updated time.Time,
	flag uint8,
	etype string,
	name string,
	body string,
	link sql.NullInt64,
) (model.Entity, error)

func (*External) Load

func (self *External) Load(stream Stream)

func (*External) Lookup

func (self *External) Lookup(ids ...int64) Stream

func (*External) Process

func (self *External) Process(stream Stream, rows *sql.Rows)

type Internal

type Internal struct {
	Store  *sql.DB
	Crates map[int64]*model.Internal
}

func NewInternal

func NewInternal(store *sql.DB) *Internal

func (*Internal) After

func (self *Internal) After(field string, search time.Time) Stream

func (*Internal) All

func (self *Internal) All() Stream

func (*Internal) Before

func (self *Internal) Before(field string, search time.Time) Stream

func (*Internal) Between

func (self *Internal) Between(
	field string,
	before time.Time,
	after time.Time,
) Stream

func (*Internal) Contains

func (self *Internal) Contains(field string, search string) Stream

func (*Internal) Create

func (self *Internal) Create() (model.Entity, error)

func (*Internal) Equals

func (self *Internal) Equals(field string, search string) Stream

func (*Internal) Get

func (self *Internal) Get(id int64) (model.Entity, error)

func (*Internal) Import

func (self *Internal) Import(
	id int64,
	uuid []byte,
	added time.Time,
	updated time.Time,
	flag uint8,
	itype string,
	origin string,
	data []byte,
) (model.Entity, error)

func (*Internal) Load

func (self *Internal) Load(stream Stream)

func (*Internal) Lookup

func (self *Internal) Lookup(ids ...int64) Stream

func (*Internal) Process

func (self *Internal) Process(stream Stream, rows *sql.Rows)

type Reader

type Reader interface {
	All() Stream
	Get(int64) (model.Entity, error)
	Lookup(...int64) Stream
	Contains(string, string) Stream
	Equals(string, string) Stream
	Before(string, time.Time) Stream
	After(string, time.Time) Stream
	Between(string, time.Time, time.Time) Stream
}

type Stream

type Stream chan model.Entity

type Tag

type Tag struct {
	Store  *sql.DB
	Crates map[int64]*model.Tag
}

func NewTag

func NewTag(store *sql.DB) *Tag

func (*Tag) After

func (self *Tag) After(field string, search time.Time) Stream

func (*Tag) All

func (self *Tag) All() Stream

func (*Tag) Before

func (self *Tag) Before(field string, search time.Time) Stream

func (*Tag) Between

func (self *Tag) Between(
	field string,
	before time.Time,
	after time.Time,
) Stream

func (*Tag) Contains

func (self *Tag) Contains(field string, search string) Stream

func (*Tag) Create

func (self *Tag) Create() (model.Entity, error)

func (*Tag) Equals

func (self *Tag) Equals(field string, search string) Stream

func (*Tag) Get

func (self *Tag) Get(id int64) (model.Entity, error)

func (*Tag) Import

func (self *Tag) Import(
	id int64,
	uuid []byte,
	added time.Time,
	updated time.Time,
	flag uint8,
	label string,
) (model.Entity, error)

func (*Tag) Load

func (self *Tag) Load(stream Stream)

func (*Tag) Lookup

func (self *Tag) Lookup(ids ...int64) Stream

func (*Tag) Process

func (self *Tag) Process(stream Stream, rows *sql.Rows)

Jump to

Keyboard shortcuts

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