Documentation ¶
Overview ¶
Package storage provides database-independent structured records persistence
Index ¶
- type ModelInstance
- type ModelInstanceDAO
- func (r *ModelInstanceDAO) DeleteAll(name string)
- func (r *ModelInstanceDAO) Find(table_name string) ([]*ModelInstance, error)
- func (r *ModelInstanceDAO) FindByQuery(table_name string, query string, params []interface{}, ...) ([]*ModelInstance, error)
- func (r *ModelInstanceDAO) Get(table_name string, id int64) (*ModelInstance, error)
- func (r *ModelInstanceDAO) Remove(tableName string, id int64) error
- func (r *ModelInstanceDAO) Store(entity *ModelInstance) error
- type ModelInstanceFactory
- type Storage
- func (s *Storage) GetEntityTypes() map[string]*model.Model
- func (s *Storage) GetFileStorage(name string) filestorage.FileStorage
- func (s *Storage) GetModelInstanceDAO() *ModelInstanceDAO
- func (s *Storage) GetModelInstanceFactory() *ModelInstanceFactory
- func (s *Storage) GetStorageSchemaManager() *StorageSchemaManager
- func (s *Storage) RegisterFileStorage(name string, path string)
- type StorageOpenOptions
- type StorageSchemaManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelInstance ¶
type ModelInstance struct {
// contains filtered or unexported fields
}
func (*ModelInstance) GetAllAttributes ¶
func (e *ModelInstance) GetAllAttributes() map[string]interface{}
func (*ModelInstance) GetId ¶
func (e *ModelInstance) GetId() int64
func (*ModelInstance) GetTableName ¶
func (e *ModelInstance) GetTableName() string
func (*ModelInstance) SetAttribute ¶
func (e *ModelInstance) SetAttribute(name string, value interface{})
func (*ModelInstance) SetId ¶
func (e *ModelInstance) SetId(id int64)
type ModelInstanceDAO ¶
type ModelInstanceDAO struct {
// contains filtered or unexported fields
}
func (*ModelInstanceDAO) DeleteAll ¶
func (r *ModelInstanceDAO) DeleteAll(name string)
func (*ModelInstanceDAO) Find ¶
func (r *ModelInstanceDAO) Find(table_name string) ([]*ModelInstance, error)
func (*ModelInstanceDAO) FindByQuery ¶
func (r *ModelInstanceDAO) FindByQuery(table_name string, query string, params []interface{}, orderBy []query.OrderClause) ([]*ModelInstance, error)
func (*ModelInstanceDAO) Get ¶
func (r *ModelInstanceDAO) Get(table_name string, id int64) (*ModelInstance, error)
TODO: maybe support passing ModelInstanceFactory deserializing directly into custom structure, without immediate ModelInstace
func (*ModelInstanceDAO) Remove ¶
func (r *ModelInstanceDAO) Remove(tableName string, id int64) error
func (*ModelInstanceDAO) Store ¶
func (r *ModelInstanceDAO) Store(entity *ModelInstance) error
type ModelInstanceFactory ¶
type ModelInstanceFactory struct {
// contains filtered or unexported fields
}
func (*ModelInstanceFactory) CreateFromMap ¶
func (factory *ModelInstanceFactory) CreateFromMap(tableName string, values map[string]interface{}) *ModelInstance
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(options StorageOpenOptions) *Storage
func (*Storage) GetFileStorage ¶
func (s *Storage) GetFileStorage(name string) filestorage.FileStorage
func (*Storage) GetModelInstanceDAO ¶
func (s *Storage) GetModelInstanceDAO() *ModelInstanceDAO
func (*Storage) GetModelInstanceFactory ¶
func (s *Storage) GetModelInstanceFactory() *ModelInstanceFactory
func (*Storage) GetStorageSchemaManager ¶
func (s *Storage) GetStorageSchemaManager() *StorageSchemaManager
func (*Storage) RegisterFileStorage ¶
type StorageOpenOptions ¶
type StorageSchemaManager ¶
type StorageSchemaManager struct {
// contains filtered or unexported fields
}
TODO: "manager" is considered to be an anti-pattern for naming, as "manager" can mean pretty much anything
func (*StorageSchemaManager) Migrate ¶
func (manager *StorageSchemaManager) Migrate(schema model.ModelSchema) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.