Documentation ¶
Index ¶
- type SQLManager
- func (s *SQLManager) Create(policy Policy) (err error)
- func (s *SQLManager) CreateSchemas(schema, table string) (int, error)
- func (s *SQLManager) Delete(id string) error
- func (s *SQLManager) FindRequestCandidates(r *Request) (Policies, error)
- func (s *SQLManager) Get(id string) (Policy, error)
- func (s *SQLManager) GetAll(limit, offset int64) (Policies, error)
- type SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLManager ¶
type SQLManager struct {
// contains filtered or unexported fields
}
SQLManager is a postgres implementation for Manager to store policies persistently.
func NewSQLManager ¶
func NewSQLManager(db *sqlx.DB, schema []string) *SQLManager
NewSQLManager initializes a new SQLManager for given db instance.
func (*SQLManager) Create ¶
func (s *SQLManager) Create(policy Policy) (err error)
Create inserts a new policy
func (*SQLManager) CreateSchemas ¶
func (s *SQLManager) CreateSchemas(schema, table string) (int, error)
CreateSchemas creates ladon_policy tables
func (*SQLManager) FindRequestCandidates ¶
func (s *SQLManager) FindRequestCandidates(r *Request) (Policies, error)
func (*SQLManager) Get ¶
func (s *SQLManager) Get(id string) (Policy, error)
Get retrieves a policy.
func (*SQLManager) GetAll ¶
func (s *SQLManager) GetAll(limit, offset int64) (Policies, error)
GetAll returns all policies
type SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7 ¶
type SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7 struct { DB *sqlx.DB SQLManager *SQLManager }
func (*SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) Create ¶
func (s *SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) Create(policy Policy) (err error)
Create inserts a new policy
func (*SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) GetManager ¶
func (s *SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) GetManager() ladon.Manager
func (*SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) Migrate ¶
func (s *SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) Migrate() error
Get retrieves a policy.
Click to show internal directories.
Click to hide internal directories.