readeradapter

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 7 Imported by: ? 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

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