fileadapter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package fileadapter provides a file adapter for Casbin.

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 is the file adapter for Casbin.

func New

func New(path string) (*Adapter, error)

New returns a new adapter that reads a policy located at the given path.

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.

Jump to

Keyboard shortcuts

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