readeradapter

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package readeradapter provides a Casbin adapter for reading policy from an io.Reader source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter reads a policy from an io.Reader source.

func New

func New(in io.Reader) (*Adapter, error)

New returns a new adapter that reads from the given io.Reader.

func (*Adapter) AddPolicy

func (a *Adapter) AddPolicy(_ string, _ string, _ []string) error

AddPolicy adds a policy rule to the storage.

func (*Adapter) LoadPolicy

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

LoadPolicy loads all policy rules from the storage.

func (*Adapter) RemoveFilteredPolicy

func (a *Adapter) RemoveFilteredPolicy(_ string, _ string, _ int, _ ...string) error

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

func (*Adapter) RemovePolicy

func (a *Adapter) RemovePolicy(_ string, _ string, _ []string) error

RemovePolicy removes a policy rule from the storage.

func (*Adapter) SavePolicy

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

SavePolicy saves all policy rules to the storage.

func (*Adapter) SetContent

func (a *Adapter) SetContent(content string)

SetContent sets the content of the adapter.

Jump to

Keyboard shortcuts

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