sql

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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) Delete

func (s *SQLManager) Delete(id string) error

Delete removes a policy.

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 (*SQLManagerMigrateFromMajor0Minor6ToMajor0Minor7) Migrate

Get retrieves a policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL