recas

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoConnetion = errors.New("connection pointer is nil")
	ErrReadOnly    = errors.New("api is marked as ReadOnly")
)
View Source
var WrongDataType = errors.New("the object has the wrong type")

Functions

func NewApi

func NewApi(conn *redis.Client, readOnly bool) *api

func NewApiWithCompression

func NewApiWithCompression(conn *redis.Client, compression tools.CompressionType, readOnly bool) *api

Types

type Adapter

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

func NewAdapter

func NewAdapter(api *api) *Adapter

func (*Adapter) AddPolicy

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

func (*Adapter) IsFiltered

func (a *Adapter) IsFiltered() bool

func (*Adapter) LoadFilteredPolicy

func (a *Adapter) LoadFilteredPolicy(model model.Model, filter interface{}) error

func (*Adapter) LoadPolicy

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

func (*Adapter) RemoveFilteredPolicy

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

func (*Adapter) RemovePolicy

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

func (*Adapter) SavePolicy

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

type ConnectionSettings

type ConnectionSettings struct {
	Network  string
	Addr     string
	Username string
	Password string
	DB       int

	ReadOnly bool
}

type Controller

type Controller struct {
	ConnSetting ConnectionSettings

	Api *api
	// contains filtered or unexported fields
}

func NewReCasController

func NewReCasController(settings ConnectionSettings) (*Controller, error)

func (*Controller) GetAdapter

func (c *Controller) GetAdapter() *Adapter

type Filter

type Filter struct {
	UserId  string
	ModelId string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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