Documentation
¶
Index ¶
- Variables
- func ListByQuery(l *ListRequest, m map[string][]string)
- 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 Policies
- type Policy
- type Registry
- type Role
- type Roles
- 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 ¶
func ListByQuery ¶
func ListByQuery(l *ListRequest, m map[string][]string)
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{}
FilterFunc func(*ListRequest, map[string][]string)
}
func (*ListRequest) Filter ¶
func (l *ListRequest) Filter(m map[string][]string) *ListRequest
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 Policy ¶
type Policy struct {
// ID is the unique identifier of the ORY Access Policy. It is used to query, update, and remove the ORY Access Policy.
ID string `json:"id"`
// Description is an optional, human-readable description.
Description string `json:"description"`
// Subjects is an array representing all the subjects this ORY Access Policy applies to.
Subjects []string `json:"subjects"`
// Resources is an array representing all the resources this ORY Access Policy applies to.
Resources []string `json:"resources"`
// Actions is an array representing all the actions this ORY Access Policy applies to.
Actions []string `json:"actions"`
// Effect is the effect of this ORY Access Policy. It can be "allow" or "deny".
Effect string `json:"effect"`
// Conditions represents a keyed object of conditions under which this ORY Access Policy is active.
Conditions map[string]interface{} `json:"conditions"`
}
Policy specifies an ORY Access Policy document.
swagger:ignore
type Role ¶
type Role struct {
// ID is the role's unique id.
ID string `json:"id"`
// Members is who belongs to the role.
Members []string `json:"members"`
}
Role represents a group of users that share the same role. A role could be an administrator, a moderator, a regular user or some other sort of role.
swagger:ignore
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.