gotiam

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpLook  = "LOOK"
	OpTouch = "TOUCH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

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

func (*Cell) CAS

func (c *Cell) CAS(ctx context.Context, actual, prev, next []byte) (bool, int, error)

func (*Cell) MaxSize

func (c *Cell) MaxSize() int

func (*Cell) Read

func (c *Cell) Read(ctx context.Context, buf []byte) (int, error)

type ErrNotAllowed

type ErrNotAllowed struct {
	Subject      PeerID
	Verb, Object string
}

func (ErrNotAllowed) Error

func (e ErrNotAllowed) Error() string

type PeerID

type PeerID = inet256.Addr

type Policy

type Policy struct {
	Rules []Rule
}

func (Policy) CanLook

func (p Policy) CanLook(peerID PeerID, name string) (ret bool)

func (Policy) CanLookAny

func (p Policy) CanLookAny(peerID PeerID) (ret bool)

func (Policy) CanTouch

func (p Policy) CanTouch(peerID PeerID, name string) (ret bool)

func (Policy) CanTouchAny

func (p Policy) CanTouchAny(peerID PeerID) (ret bool)

type Rule

type Rule struct {
	Allow   bool
	Subject PeerID
	Verb    string
	Object  *regexp.Regexp
}

func (Rule) Allows

func (r Rule) Allows(sub PeerID, method, obj string) bool

func (Rule) Denies

func (r Rule) Denies(sub PeerID, method, obj string) bool

func (Rule) Matches

func (r Rule) Matches(sub PeerID, method, obj string) bool

type Space

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

func NewSpace

func NewSpace(x branches.Space, pol Policy, peerID PeerID) *Space

func (*Space) Create

func (s *Space) Create(ctx context.Context, k string, md branches.Metadata) (*branches.Branch, error)

func (*Space) Delete

func (s *Space) Delete(ctx context.Context, k string) error

func (*Space) Get

func (s *Space) Get(ctx context.Context, k string) (*branches.Branch, error)

func (*Space) List added in v0.0.3

func (s *Space) List(ctx context.Context, span branches.Span, limit int) ([]string, error)

func (*Space) Set added in v0.0.3

func (s *Space) Set(ctx context.Context, k string, md branches.Metadata) error

type Store

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

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id cadata.ID) error

func (*Store) Exists

func (s *Store) Exists(ctx context.Context, id cadata.ID) (bool, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id cadata.ID, buf []byte) (int, error)

func (*Store) Hash

func (s *Store) Hash(x []byte) cadata.ID

func (*Store) List

func (s *Store) List(ctx context.Context, span cadata.Span, ids []cadata.ID) (int, error)

func (*Store) MaxSize

func (s *Store) MaxSize() int

func (*Store) Post

func (s *Store) Post(ctx context.Context, data []byte) (cadata.ID, error)

Jump to

Keyboard shortcuts

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