mysql

package
v0.0.0-...-fa598d4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormAdapter

type GormAdapter struct {
	// contains filtered or unexported fields
}

MysqlGormAdapter represents the Xorm adapter for policy storage.

func NewGormAdapter

func NewGormAdapter() *GormAdapter

func (*GormAdapter) AddPolicy

func (a *GormAdapter) AddPolicy(sec string, ptype string, rule []string) error

AddPolicy adds a policy rule to the storage.

func (*GormAdapter) LoadPolicy

func (a *GormAdapter) LoadPolicy(model model.Model) error

LoadPolicy loads policy from database.

func (*GormAdapter) RemoveFilteredPolicy

func (a *GormAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error

RemoveFilteredPolicy removes policy rules that match the filter from the storage.

func (*GormAdapter) RemovePolicy

func (a *GormAdapter) RemovePolicy(sec string, ptype string, rule []string) error

RemovePolicy removes a policy rule from the storage.

func (*GormAdapter) SavePolicy

func (a *GormAdapter) SavePolicy(model model.Model) error

SavePolicy saves policy to database.

Jump to

Keyboard shortcuts

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