toyinmemory

package
v0.0.0-...-34e475e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(expr Expr, env interface{}) (bool, error)

Eval :

func GreaterThan

func GreaterThan(x interface{}, y interface{}) (bool, error)

GreaterThan is x > y

func GreaterThanEqual

func GreaterThanEqual(x interface{}, y interface{}) (bool, error)

GreaterThanEqual is x >= y

func Materialize

func Materialize(dst *Object, src interface{}) error

Materialize :

func Unmaterialize

func Unmaterialize(dst interface{}, src *Object) error

Unmaterialize :

func WithName

func WithName(name string) func(*Config)

WithName :

Types

type Client

type Client struct {
	Config   *Config
	Universe *Universe
}

Client :

func Connect

func Connect(ctx context.Context, options ...func(*Config)) *Client

Connect :

func (*Client) Close

func (c *Client) Close() error

Close :

func (*Client) Session

func (c *Client) Session(ctx context.Context) (toyquery.Session, error)

Session :

type Config

type Config struct {
	Name       string
	PrimaryKey string // default primarykey TODO: implementation
	AutoCreate bool
}

Config :

type Expr

type Expr struct {
	Op    string
	Name  string
	Value interface{}
}

func Parse

func Parse(s string, val interface{}) (Expr, error)

Parse

type ID

type ID = string

ID :

type Object

type Object map[string]interface{}

Object :

type Session

type Session struct {
	Client *Client
}

Session :

func (*Session) Close

func (s *Session) Close() error

Close :

func (*Session) Exec

func (s *Session) Exec(ctx context.Context, code string) error

Exec

func (*Session) Table

func (s *Session) Table(ctx context.Context, name string) (toyquery.Table, error)

Table :

type Universe

type Universe struct {
	Name   string
	Worlds map[string]*World
}

Universe :

func (*Universe) NewWorld

func (u *Universe) NewWorld(name string) *World

NewWorld :

type World

type World struct {
	Name    string
	Objects map[ID]*Object
}

World :

func (*World) Count

func (w *World) Count(ctx context.Context, options ...func(*toyquery.QOption)) (int, error)

Count :

func (*World) Describe

func (w *World) Describe() string

Describe :

func (*World) Get

func (w *World) Get(ctx context.Context, dst interface{}, options ...func(*toyquery.QOption)) error

Get :

func (*World) GetByID

func (w *World) GetByID(ctx context.Context, id ID, dst interface{}) error

GetByID :

func (*World) InsertByID

func (w *World) InsertByID(ctx context.Context, id ID, src interface{}) error

InsertByID :

Jump to

Keyboard shortcuts

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