Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package policy evaluates a seat's committed capability manifest. It is the single place the platform decides what a seat may do; transports never change the answer (§7.2, §10.1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allows

func Allows(sm *compile.SeatManifest, resource, op string) bool

Allows reports whether the seat holds op on resource.

func CanReplyToSeat

func CanReplyToSeat(sm *compile.SeatManifest, sender string) bool

CanReplyToSeat reports whether the seat may reply to a message from sender: it has its own route to the sender, or the sender's route permits replies.

func Capability

func Capability(sm *compile.SeatManifest, resource string) (compile.Capability, bool)

Capability returns the seat's capability on resource (memory:<k>, connection:<k>).

func ConnectionAllowed

func ConnectionAllowed(sm *compile.SeatManifest, connection, op, target string) bool

ConnectionAllowed checks a gateway call against the grant for the connection: the operation must be granted, and when the grant restricts targets the call's target must match one of them.

func Connections

func Connections(sm *compile.SeatManifest) map[string]compile.Capability

Connections returns the seat's connection capabilities keyed by connection.

func HasBinding

func HasBinding(sm *compile.SeatManifest, binding string) bool

HasBinding reports whether the seat is the representative of binding.

func HasMemory

func HasMemory(sm *compile.SeatManifest, op string) bool

HasMemory reports whether the seat holds op on any memory store.

func MatchTarget

func MatchTarget(patterns []string, target string) bool

MatchTarget matches target against grant targets. A target pattern is an exact value, "*", or a prefix ending in "*".

func MemoryStores

func MemoryStores(sm *compile.SeatManifest, op string) []string

MemoryStores returns the keys of the memory stores on which the seat holds op.

func Reachable

func Reachable(sm *compile.SeatManifest) []string

Reachable returns the seats the seat can message or that can message it.

func SendEdge

func SendEdge(sm *compile.SeatManifest, recipient string) (compile.RouteEdge, bool)

SendEdge returns the declared route from the seat to recipient.

Types

This section is empty.

Jump to

Keyboard shortcuts

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