Help us shape the future of Go! Take the 2026 Go Developer Survey

sql

package
v0.7.5 Latest Latest
Warning

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

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

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