act

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrACTAlreadyExists = errors.New("ACT already exists")
	ErrACTDoesNowExist  = errors.New("ACT does not exist")
)

Functions

This section is empty.

Types

type ACT

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

func NewACT

func NewACT(client blockstore.Client, feed *feed.API, account *account.Account, m taskmanager.TaskManagerGO, logger logging.Logger) *ACT

func (*ACT) CreateUpdateACT

func (t *ACT) CreateUpdateACT(actName string, publicKeyGrant, publicKeyRevoke *ecdsa.PublicKey) (*Act, error)

func (*ACT) GetACT

func (t *ACT) GetACT(actName string) (*Act, error)

func (*ACT) GetContentList

func (t *ACT) GetContentList(actName string) ([]*Content, error)

func (*ACT) GetGrantees

func (t *ACT) GetGrantees(actName string) ([]string, error)

func (*ACT) GetList

func (t *ACT) GetList() (List, error)

func (*ACT) GetPodAccess

func (t *ACT) GetPodAccess(actName string) (swarm.Address, error)

func (*ACT) GrantAccess

func (t *ACT) GrantAccess(actName string, address swarm.Address) (*Content, error)

func (*ACT) SaveGrantedPod

func (t *ACT) SaveGrantedPod(actName string, c *Content) error

type Act

type Act struct {
	Name        string     `json:"name"`
	HistoryRef  string     `json:"historyRef"`
	GranteesRef string     `json:"granteesRef"`
	CreatedAt   time.Time  `json:"createdAt"`
	Content     []*Content `json:"content"`
}

Act represents an Access Control Trie (ACT) with its metadata, grantees, and associated content.

type Content

type Content struct {
	Reference      string        `json:"reference"`
	Topic          []byte        `json:"topic"`
	Owner          utils.Address `json:"owner"`
	OwnerPublicKey string        `json:"ownerPublicKey"`
	AddedAt        time.Time     `json:"addedAt"`
}

Content represents a pod or data reference associated with the ACT.

type List

type List map[string]*Act

Jump to

Keyboard shortcuts

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