pathgrant

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadAccess  = shell.ReadAccess
	ExecAccess  = shell.ExecAccess
	WriteAccess = shell.WriteAccess
)
View Source
const Change agent.Kind = "path_grant_change"
View Source
const (
	GrantUsage = "{r|rw} <path>..."
)

Variables

This section is empty.

Functions

func ChangeEvent

func ChangeEvent(path string, grants []Grant) (agent.Event, error)

func IsTemporaryAccess added in v0.12.0

func IsTemporaryAccess(access Access) bool

func NewRestored

func NewRestored(
	workspace *work.Space,
	pathAccess *shell.PathAccess,
	recordedGrants []Grant,
) (*Grants, RestoreResult)

func Notice

func Notice(event agent.Event) (string, bool)

func Summary

func Summary(event agent.Event) (string, bool)

func WithGrantOf

func WithGrantOf(event agent.Event, path string, grants []Grant) agent.Event

Types

type Access

type Access = shell.Access

type Grant

type Grant = shell.PathGrant

func LastRecorded

func LastRecorded(events []agent.Event) ([]Grant, bool)

type Grants

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

func New

func New(workspace *work.Space, pathAccess *shell.PathAccess) *Grants

func (*Grants) GetCurrent

func (self *Grants) GetCurrent() []Grant

func (*Grants) Grant

func (self *Grants) Grant(path string, access Access) (agent.Event, error)

func (*Grants) Inject

func (self *Grants) Inject() string

func (*Grants) IsTold

func (self *Grants) IsTold(path string) bool

func (*Grants) Peek

func (self *Grants) Peek() string

func (*Grants) Revoke

func (self *Grants) Revoke(path string) (agent.Event, error)

type RestoreFailure

type RestoreFailure struct {
	Grant Grant
	Err   error
}

type RestoreResult

type RestoreResult struct {
	Failures []RestoreFailure
}

Jump to

Keyboard shortcuts

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