database

package
v0.0.0-...-839bc5d Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContinuousToken

type ContinuousToken interface {
	// Encode encodes the continuous token to a string.
	Encode() EncodedContinuousToken
}

ContinuousToken -

type Database

type Database interface {
	// GetEngineType get the database type (e.g. postgres, memory, etc.).
	GetEngineType() string

	// Close the database connection.
	Close() error

	// IsReady - Check if database is ready
	IsReady(ctx context.Context) (bool, error)
}

Database - Db interface

type EncodedContinuousToken

type EncodedContinuousToken interface {
	// String returns the string representation of the continuous token.
	String() string
	// Decode decodes the continuous token from a string
	Decode() (ContinuousToken, error)
}

EncodedContinuousToken -

type Engine

type Engine string

Engine - Type declaration of engine

const (
	POSTGRES Engine = "postgres"
	MEMORY   Engine = "memory"
)

func (Engine) String

func (c Engine) String() string

String - Convert to string

type EntityCollection

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

EntityCollection - Entity collection.

func NewEntityCollection

func NewEntityCollection(entities ...*base.Entity) *EntityCollection

NewEntityCollection - Create new subject collection.

func (*EntityCollection) Add

func (e *EntityCollection) Add(entity *base.Entity)

Add - New subject to collection.

func (*EntityCollection) CreateEntityIterator

func (e *EntityCollection) CreateEntityIterator() *EntityIterator

CreateEntityIterator - Create entity iterator according to collection.

func (*EntityCollection) GetEntities

func (e *EntityCollection) GetEntities() []*base.Entity

GetEntities - Get entities

type EntityIterator

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

EntityIterator - Structure for entity iterator

func NewEntityIterator

func NewEntityIterator(entities []*base.Entity) *EntityIterator

NewEntityIterator -

func (*EntityIterator) GetNext

func (u *EntityIterator) GetNext() *base.Entity

GetNext - Get next entity

func (*EntityIterator) HasNext

func (u *EntityIterator) HasNext() bool

HasNext - Checks whether next entity exists

type Option

type Option func(*Pagination)

Option - Option type

func Size

func Size(size uint32) Option

Size -

func Token

func Token(token string) Option

Token -

type Pagination

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

Pagination -

func NewPagination

func NewPagination(opts ...Option) Pagination

NewPagination -

func (Pagination) PageSize

func (p Pagination) PageSize() uint32

PageSize -

func (Pagination) Token

func (p Pagination) Token() string

Token -

type SubjectCollection

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

SubjectCollection - Subject collection.

func NewSubjectCollection

func NewSubjectCollection(subjects ...*base.Subject) *SubjectCollection

NewSubjectCollection - Create new subject collection.

func (*SubjectCollection) Add

func (s *SubjectCollection) Add(subject *base.Subject)

Add - New subject to collection.

func (*SubjectCollection) CreateSubjectIterator

func (s *SubjectCollection) CreateSubjectIterator() *SubjectIterator

CreateSubjectIterator - Create subject iterator according to collection.

func (*SubjectCollection) GetSubjects

func (s *SubjectCollection) GetSubjects() []*base.Subject

GetSubjects - Get subject collection

type SubjectIterator

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

SubjectIterator - Structure for subject iterator

func NewSubjectIterator

func NewSubjectIterator(subjects []*base.Subject) *SubjectIterator

NewSubjectIterator -

func (*SubjectIterator) GetNext

func (u *SubjectIterator) GetNext() *base.Subject

GetNext - Get next tuple

func (*SubjectIterator) HasNext

func (u *SubjectIterator) HasNext() bool

HasNext - Checks whether next subject exists

type TupleCollection

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

TupleCollection -Tuple collection.

func NewTupleCollection

func NewTupleCollection(tuples ...*base.Tuple) *TupleCollection

NewTupleCollection - Create new tuple collection.

func (*TupleCollection) Add

func (t *TupleCollection) Add(tuple *base.Tuple)

Add - New subject to collection.

func (*TupleCollection) CreateTupleIterator

func (t *TupleCollection) CreateTupleIterator() *TupleIterator

CreateTupleIterator - Create tuple iterator according to collection.

func (*TupleCollection) GetTuples

func (t *TupleCollection) GetTuples() []*base.Tuple

GetTuples - Get tuples

func (*TupleCollection) ToSubjectCollection

func (t *TupleCollection) ToSubjectCollection() *SubjectCollection

ToSubjectCollection - Converts new subject collection from given tuple collection

type TupleIterator

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

TupleIterator - Tuple iterator -

func NewTupleIterator

func NewTupleIterator(tuples ...*base.Tuple) *TupleIterator

NewTupleIterator -

func (*TupleIterator) GetNext

func (i *TupleIterator) GetNext() *base.Tuple

GetNext - Get next tuple

func (*TupleIterator) HasNext

func (i *TupleIterator) HasNext() bool

HasNext - Checks whether next tuple exists

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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