Versions in this module Expand all Collapse all v0 v0.0.2 Dec 15, 2025 Changes in this version type Daemon + func BGTestDaemon(t testing.TB) (*Daemon, string) v0.0.1 Nov 25, 2025 Changes in this version + const ActionsFilename + const GrantsFilename + const IdentitiesFilename + const ObjectsFilename + var Everyone = inet256.Everyone() + func AwaitHealthy(ctx context.Context, svc blobcache.Service) error + func DefaultActionsFile() (ret string) + func DefaultGrantsFile() (ret string) + func DefaultIdentitiesFile() (ret string) + func DefaultObjectsFile() (ret string) + func LoadPrivateKey(p string) (inet256.PrivateKey, error) + func SavePrivateKey(p string, privKey inet256.PrivateKey) error + func WriteActionsFile(w io.Writer, actions []Membership[Action]) error + func WriteGrantsFile(w io.Writer, grants []Grant) error + func WriteGroupsFile[T any](w io.Writer, membership []Membership[T], format func(T) string) error + func WriteIdentitiesFile(w io.Writer, membership []Membership[Identity]) error + func WriteObjectsFile(w io.Writer, objects []Membership[ObjectSet]) error + type Action string + const Action_CLONE + const Action_COPY_FROM + const Action_COPY_TO + const Action_CREATE + const Action_DELETE + const Action_EXISTS + const Action_GET + const Action_LINK_FROM + const Action_LINK_TO + const Action_LOAD + const Action_POST + const Action_SAVE + const Action_UNLINK_FROM + func AllActions() []Action + func ParseAction(x []byte) (Action, error) + func (a Action) String() string + func (a Action) ToSet() blobcache.ActionSet + type Daemon struct + StateDir string + func RunTestDaemon(t testing.TB) (*Daemon, string) + func (d *Daemon) EnsurePolicyFiles() error + func (d *Daemon) EnsurePrivateKey() (inet256.PrivateKey, error) + func (d *Daemon) GetPeerID() (blobcache.PeerID, error) + func (d *Daemon) GetPolicy() (*Policy, error) + func (d *Daemon) Run(ctx context.Context, pc net.PacketConn, serveAPI net.Listener) error + type Grant struct + Action Member[Action] + Object Member[ObjectSet] + Subject Member[Identity] + func LoadGrantsFile(p string) ([]Grant, error) + func ParseGrantsFile(r io.Reader) (ret []Grant, _ error) + func (g *Grant) Equals(other Grant) bool + type GroupName string + func ParseGroupName(x []byte) (GroupName, error) + type Identity = blobcache.PeerID + func ParseIdentity(x []byte) (Identity, error) + type Member struct + Empty *struct{} + GroupRef *GroupName + Unit *T + func GroupRef[T any](subGroup GroupName) Member[T] + func ParseMember[T any](data []byte, parse func([]byte) (T, error)) (Member[T], error) + func Unit[T any](unit T) Member[T] + func (m Member[T]) Format(format func(T) string) string + type Membership struct + Group GroupName + Member Member[T] + func LoadActionsFile(p string) ([]Membership[Action], error) + func LoadIdentitiesFile(p string) ([]Membership[Identity], error) + func LoadObjectsFile(p string) ([]Membership[ObjectSet], error) + func ParseActionsFile(r io.Reader) (ret []Membership[Action], _ error) + func ParseGroupsFile[T any](r io.Reader, parse func([]byte) (T, error)) (ret []Membership[T], _ error) + func ParseIdentitiesFile(r io.Reader) (ret []Membership[Identity], _ error) + func ParseObjectsFile(r io.Reader) (ret []Membership[ObjectSet], _ error) + type ObjectSet struct + All *struct{} + ByOID *blobcache.OID + func ParseObject(x []byte) (ObjectSet, error) + func (o ObjectSet) Equals(other ObjectSet) bool + func (o ObjectSet) String() string + type Policy struct + func LoadPolicy(stateDir string) (*Policy, error) + func NewPolicy(idens []Membership[Identity], actions []Membership[Action], ...) (*Policy, error) + func (p *Policy) AllActionGroups() iter.Seq[string] + func (p *Policy) AllGrants() iter.Seq[Grant] + func (p *Policy) AllIdentityGroups() iter.Seq[string] + func (p *Policy) AllObjectGroups() iter.Seq[string] + func (p *Policy) CanConnect(peer blobcache.PeerID) bool + func (p *Policy) CanCreate(peer blobcache.PeerID) bool + func (p *Policy) IdentityMembersOf(group string) iter.Seq[Identity] + func (p *Policy) IsIdentityDefined(iden Identity) bool + func (p *Policy) OpenFiat(peer blobcache.PeerID, target blobcache.OID) blobcache.ActionSet