Documentation ¶
Index ¶
- func ManagerAll(manager ManagerI) []Model
- func ManagerFilter(manager ManagerI, include Params, _ ...Params) []Model
- type Collection
- func (collection *Collection) Count() uint
- func (collection *Collection) DB() DB
- func (collection *Collection) Delete(idI any) error
- func (collection *Collection) DeleteAll() error
- func (collection *Collection) Get(idI any) (Model, error)
- func (collection *Collection) Manager() ManagerI
- func (collection *Collection) Model() Model
- func (collection *Collection) Name() string
- func (collection *Collection) Save(model Model) error
- func (collection *Collection) SetManager(newManager ManagerI)
- type DataBase
- func (db *DataBase) Close() error
- func (db *DataBase) CreateCollection(name string, model Model) error
- func (db *DataBase) DB() *PocketBase
- func (db *DataBase) ExistsTable(name string) bool
- func (db *DataBase) Table(name string, model Model) (Table, error)
- func (db *DataBase) TableFromCache(name string) Table
- type Form
- type PocketBase
- func (app *PocketBase) Address() string
- func (pb *PocketBase) CreateCollection(data map[string]any) error
- func (pb *PocketBase) Delete(collectionNameOrId, id string) error
- func (pb *PocketBase) Filter(collectionNameOrId string, data map[string]any, page ...uint) ([]*Record, error)
- func (pb *PocketBase) GetFileAsSliceByte(collentionNameOrId, recordId, fileName string) ([]byte, error)
- func (app *PocketBase) IsAdmin() bool
- func (app *PocketBase) Local() bool
- func (pb *PocketBase) UpdateCollection(data map[string]any) error
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManagerAll ¶ added in v0.13.0
func ManagerAll(manager ManagerI) []Model
func ManagerFilter ¶ added in v0.13.0
func ManagerFilter(manager ManagerI, include Params, _ ...Params) []Model
Types ¶
type Collection ¶ added in v0.13.0
type Collection struct { Objects ManagerI // contains filtered or unexported fields }
func (*Collection) Count ¶ added in v0.13.0
func (collection *Collection) Count() uint
func (*Collection) DB ¶ added in v0.13.0
func (collection *Collection) DB() DB
func (*Collection) Delete ¶ added in v0.13.0
func (collection *Collection) Delete(idI any) error
func (*Collection) DeleteAll ¶ added in v0.13.0
func (collection *Collection) DeleteAll() error
Pocketbase does not support DeleteAll All models will be deletting of one
func (*Collection) Get ¶ added in v0.13.0
func (collection *Collection) Get(idI any) (Model, error)
func (*Collection) Manager ¶ added in v0.13.0
func (collection *Collection) Manager() ManagerI
func (*Collection) Model ¶ added in v0.13.0
func (collection *Collection) Model() Model
func (*Collection) Name ¶ added in v0.13.0
func (collection *Collection) Name() string
func (*Collection) Save ¶ added in v0.13.0
func (collection *Collection) Save(model Model) error
func (*Collection) SetManager ¶ added in v0.13.0
func (collection *Collection) SetManager(newManager ManagerI)
type DataBase ¶ added in v0.11.0
type DataBase struct {
// contains filtered or unexported fields
}
func OpenWith ¶ added in v0.11.0
func OpenWith(pb *PocketBase) *DataBase
func (*DataBase) CreateCollection ¶ added in v0.14.0
func (*DataBase) DB ¶ added in v0.14.1
func (db *DataBase) DB() *PocketBase
func (*DataBase) ExistsTable ¶ added in v0.11.0
func (*DataBase) TableFromCache ¶ added in v0.12.1
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
Form структура формы для создания или обновления записи
func NewForm ¶
func NewForm(app *PocketBase, record *Record) *Form
NewForm возвращает экземпляр *Form
type PocketBase ¶
type PocketBase struct {
// contains filtered or unexported fields
}
Pocketbase структура с данными авторизации для pb
func New ¶
func New(address, identity, password string, isAdmin bool, updateCollections ...bool) *PocketBase
New возвращает экземпляр *Pocketbase с адресом `address`, индификатором `identity` и паролем `password`
address in format - http(s)://127.0.0.1(:8090)
func (*PocketBase) Address ¶ added in v0.14.0
func (app *PocketBase) Address() string
func (*PocketBase) CreateCollection ¶ added in v0.14.0
func (pb *PocketBase) CreateCollection(data map[string]any) error
func (*PocketBase) Delete ¶
func (pb *PocketBase) Delete(collectionNameOrId, id string) error
func (*PocketBase) Filter ¶
func (pb *PocketBase) Filter(collectionNameOrId string, data map[string]any, page ...uint) ([]*Record, error)
PocketBase.Filter возвращает список записей из pb удовлетворяющим фильтру `data`
func (*PocketBase) GetFileAsSliceByte ¶
func (pb *PocketBase) GetFileAsSliceByte(collentionNameOrId, recordId, fileName string) ([]byte, error)
PocketBase.GetFileAsSliceByte возвращает список байтов файла из pb
func (*PocketBase) IsAdmin ¶ added in v0.15.0
func (app *PocketBase) IsAdmin() bool
func (*PocketBase) Local ¶ added in v0.14.0
func (app *PocketBase) Local() bool
func (*PocketBase) UpdateCollection ¶ added in v0.14.0
func (pb *PocketBase) UpdateCollection(data map[string]any) error
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record структура записи в pb
func NewRecord ¶
func NewRecord(collectionNameOrId string, app *PocketBase) *Record
NewRecord возвращает экземпляр *Record
func (*Record) CollectionNameOrId ¶
Record.CollectionNameOrId возвращает имяИлиId колекции
Click to show internal directories.
Click to hide internal directories.