interfaces

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONParse added in v0.15.0

func JSONParse(data []byte, model Model) error

Types

type DB

type DB interface {
	Close() error

	Table(name string, model Model) (Table, error)
	ExistsTable(name string) bool
	TableFromCache(name string) Table
	TableOfModel(model Model) Table
}

type ManagerI

type ManagerI interface {
	IsInstance() bool
	Table() Table
	Copy() ManagerI
	Clear()

	Get(id any) Model
	Delete(id any)
	Store(id any, model Model)
	ClearId(id any)

	Broadcast(Nexter)
	All() []Model
	Filter(include Params, exclude ...Params) ManagerI

	Count() uint
	First() Model
	Last() Model
}

type Model

type Model interface {
	Create(DB, string) Model // Create(DB, jsonString) Model

	Id() any
	Save(table Table) error
	Delete(DB) error
}

type Nexter added in v0.13.0

type Nexter func() any

type PBTime added in v0.14.0

type PBTime time.Time

Pocketbase return time in `2006-01-02 15:04:05Z` format. And package time parsing in `2006-01-02T15:04:05Z07:00` format.

func (*PBTime) MarshalJSON added in v0.15.0

func (pbt *PBTime) MarshalJSON() ([]byte, error)

func (*PBTime) Unmarshal added in v0.14.0

func (pbt *PBTime) Unmarshal(data []byte) error

type Params

type Params map[string]any

type Table

type Table interface {
	Name() string
	DB() DB
	Model() Model

	Get(id any) (Model, error)
	Save(model Model) error
	Delete(id any) error

	DeleteAll() error
	Count() uint
	Manager() ManagerI
	SetManager(ManagerI)
}

Jump to

Keyboard shortcuts

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