Documentation
¶
Index ¶
Constants ¶
const (
MapServiceName = "map"
)
Variables ¶
var ( ReadCap = []byte("read") WriteCap = []byte("write") )
var ( ErrStatusNotFound = errors.New("StatusNotFound") ErrStatusFailed = errors.New("StatusFailed") )
Functions ¶
This section is empty.
Types ¶
type MapRequest ¶
type MapRequest struct {
// ID is the ID of the block which is a ed25519 PublicKey
ID MessageID
// Future version may wish to include the PublicKey
// if PublicKeySize is
// Signature is the signature over Payload with
// The Read or Write capability keys for the entry
// identified by ID
Signature []byte
// Payload is the contents to store or nil
Payload []byte
}
func (*MapRequest) Marshal ¶
func (m *MapRequest) Marshal() ([]byte, error)
func (*MapRequest) Unmarshal ¶
func (m *MapRequest) Unmarshal(b []byte) error
type MapResponse ¶
func (*MapResponse) Marshal ¶
func (m *MapResponse) Marshal() ([]byte, error)
func (*MapResponse) Unmarshal ¶
func (m *MapResponse) Unmarshal(b []byte) error
type MessageID ¶
type MessageID [ed25519.PublicKeySize]byte
MessageID represents a storage address with Read/Write capability
func (MessageID) ReadVerifier ¶
ReadVerifier returns the verifier of ReadCap for this ID
func (MessageID) WriteVerifier ¶
WriteVerifier returns the verifier of WriteCap for this ID
type ROCap ¶
type ROCap struct {
RootCap
// Read capability keys
CapRSk *ed25519.BlindedPrivateKey
CapRPk *ed25519.PublicKey
}
ROCap holds the keys implementing Read Capabilities using blinded ed25519 keys
type RWCap ¶
type RWCap struct {
RootCap
ROCap
WOCap
// capability root private key from which other keys are derived
CapSk *ed25519.PrivateKey
}
RWCap holds the keys implementing Read/Write Capabilities using blinded ed25519 keys
func NewRWCap ¶
func NewRWCap(root *ed25519.PrivateKey) *RWCap
NewRWCap returns a Cap initialized with capability keys from a root key
type ReadOnlyCap ¶
type ReadOnlyCap interface {
Cap
ReadKey(addr []byte) *ed25519.BlindedPrivateKey
}
ReadOnlyCap describes a Capability that has Read capability only.
type ReadWriteCap ¶
type ReadWriteCap interface {
Cap
ReadOnlyCap
WriteOnlyCap
ReadOnly() ReadOnlyCap
WriteOnly() WriteOnlyCap
}
ReadWriteCap describes a Capability that has Read and Write capabilities and can return ReadOnly and WriteOnly capabilities
type RootCap ¶
RootCap holds CapPk and implements the Addr method which other capability types inherit.
type WOCap ¶
type WOCap struct {
RootCap
// Write capability keys
CapWSk *ed25519.BlindedPrivateKey
CapWPk *ed25519.PublicKey
}
WOCap holds the keys implementing Write Capabilities using blinded ed25519 keys
type WriteOnlyCap ¶
type WriteOnlyCap interface {
Cap
WriteKey(addr []byte) *ed25519.BlindedPrivateKey
}
ReadOnlyCap describes a Capability that has Write capability only.