Documentation
¶
Index ¶
- Variables
- type DeleteRequest
- type GetRequest
- type Handler
- type ListRequest
- type Manager
- type MemoryManager
- func (m *MemoryManager) Delete(_ context.Context, collection, key string) error
- func (m *MemoryManager) Get(_ context.Context, collection, key string, value interface{}) error
- func (m *MemoryManager) List(ctx context.Context, collection string, value interface{}, limit, offset int) error
- func (m *MemoryManager) Storage(ctx context.Context, schema string, collections []string) (storage.Store, error)
- func (m *MemoryManager) Upsert(_ context.Context, collection, key string, value interface{}) error
- type Registry
- type SQLManager
- func (m *SQLManager) CreateSchemas(db *sqlx.DB) (int, error)
- func (m *SQLManager) Delete(ctx context.Context, collection, key string) error
- func (m *SQLManager) Get(ctx context.Context, collection, key string, value interface{}) error
- func (m *SQLManager) List(ctx context.Context, collection string, value interface{}, limit, offset int) error
- func (m *SQLManager) Storage(ctx context.Context, schema string, collections []string) (storage.Store, error)
- func (m *SQLManager) Upsert(ctx context.Context, collection, key string, value interface{}) error
- type UpsertRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var Migrations = map[string]*migrate.MemoryMigrationSource{ dbal.DriverMySQL: { Migrations: []*migrate.Migration{ { Id: "1", Up: []string{ `CREATE TABLE IF NOT EXISTS rego_data ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, collection VARCHAR(64) NOT NULL, pkey VARCHAR(64) NOT NULL, document JSON, UNIQUE KEY rego_data_uidx_ck (collection, pkey) )`, }, Down: []string{ "DROP TABLE rego_data", }, }, }, }, dbal.DriverPostgreSQL: { Migrations: []*migrate.Migration{ { Id: "1", Up: []string{ `CREATE TABLE IF NOT EXISTS rego_data ( id SERIAL PRIMARY KEY, collection VARCHAR(64) NOT NULL, pkey VARCHAR(64) NOT NULL, document JSON )`, `CREATE UNIQUE INDEX rego_data_uidx_ck ON rego_data (collection, pkey)`, }, Down: []string{ "DROP TABLE rego_data", }, }, }, }, }
Functions ¶
This section is empty.
Types ¶
type DeleteRequest ¶
type GetRequest ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Delete ¶
func (h *Handler) Delete(factory func(context.Context, *http.Request, httprouter.Params) (*DeleteRequest, error)) httprouter.Handle
func (*Handler) Get ¶
func (h *Handler) Get(factory func(context.Context, *http.Request, httprouter.Params) (*GetRequest, error)) httprouter.Handle
func (*Handler) List ¶
func (h *Handler) List(factory func(context.Context, *http.Request, httprouter.Params) (*ListRequest, error)) httprouter.Handle
func (*Handler) Upsert ¶
func (h *Handler) Upsert(factory func(context.Context, *http.Request, httprouter.Params) (*UpsertRequest, error)) httprouter.Handle
type ListRequest ¶
type ListRequest struct {
Collection string
Value interface{}
}
type Manager ¶
type Manager interface {
Get(ctx context.Context, collection string, key string, value interface{}) error
List(ctx context.Context, collection string, value interface{}, limit, offset int) error
Upsert(ctx context.Context, collection string, key string, value interface{}) error
Delete(ctx context.Context, collection string, key string) error
Storage(ctx context.Context, schema string, collections []string) (storage.Store, error)
}
type MemoryManager ¶
func NewMemoryManager ¶
func NewMemoryManager() *MemoryManager
func (*MemoryManager) Delete ¶
func (m *MemoryManager) Delete(_ context.Context, collection, key string) error
func (*MemoryManager) Get ¶
func (m *MemoryManager) Get(_ context.Context, collection, key string, value interface{}) error
type SQLManager ¶
type SQLManager struct {
// contains filtered or unexported fields
}
func NewSQLManager ¶
func NewSQLManager(db *sqlx.DB) *SQLManager
func (*SQLManager) CreateSchemas ¶
func (m *SQLManager) CreateSchemas(db *sqlx.DB) (int, error)
func (*SQLManager) Delete ¶
func (m *SQLManager) Delete(ctx context.Context, collection, key string) error
func (*SQLManager) Get ¶
func (m *SQLManager) Get(ctx context.Context, collection, key string, value interface{}) error
type UpsertRequest ¶
Click to show internal directories.
Click to hide internal directories.