Documentation
¶
Index ¶
- Constants
- Variables
- func AppendToSpool(spoolID [SpoolIDSize]byte, message []byte) ([]byte, error)
- func CreateSpool(privKey *eddsa.PrivateKey) ([]byte, error)
- func PurgeSpool(spoolID [SpoolIDSize]byte, privKey *eddsa.PrivateKey) ([]byte, error)
- func ReadFromSpool(spoolID [SpoolIDSize]byte, messageID uint32, privKey *eddsa.PrivateKey) ([]byte, error)
- type SpoolRequest
- type SpoolResponse
Constants ¶
View Source
const ( // SpoolIDSize is the size of a spool identity SpoolIDSize = 12 // SignatureSize is the size of a spool command signature SignatureSize = 64 // PublicKeySize is the size of a public key for verifying // spool command signatures. PublicKeySize = 32 // MessageIDSize is the size of a message identity. MessageIDSize = 4 // ResponsePadding is size of the padding of the spool service response. ResponsePadding = 171 // QueryOverhead is the number of bytes overhead // from the spool command CBOR encoding. QueryOverhead = 171 // CreateSpoolCommand is the identity of the create spool command. CreateSpoolCommand = 0 // PurgeSpoolCommand is the identity of the purge spool command. PurgeSpoolCommand = 1 // AppendMessageCommand is the identity of the append message command. AppendMessageCommand = 2 // RetrieveMessageCommand is the identity of the retrieve message command. RetrieveMessageCommand = 3 // SpoolServiceName is the canonical name of the memspool service. SpoolServiceName = "spool" // StatusOK is a status string indicating there was no error on the spool operation. StatusOK = "OK" )
Variables ¶
View Source
var SpoolPayloadLength = (constants.UserForwardPayloadLength - 4) - QueryOverhead
SpoolPayloadLength is the length of the spool append message payload.
Functions ¶
func AppendToSpool ¶
func AppendToSpool(spoolID [SpoolIDSize]byte, message []byte) ([]byte, error)
func CreateSpool ¶
func CreateSpool(privKey *eddsa.PrivateKey) ([]byte, error)
func PurgeSpool ¶
func PurgeSpool(spoolID [SpoolIDSize]byte, privKey *eddsa.PrivateKey) ([]byte, error)
func ReadFromSpool ¶
func ReadFromSpool(spoolID [SpoolIDSize]byte, messageID uint32, privKey *eddsa.PrivateKey) ([]byte, error)
Types ¶
type SpoolRequest ¶
type SpoolRequest struct { Command byte // SpoolID identities a spool on a particular Provider host. // This field must be SpoolIDSize bytes long. SpoolID [SpoolIDSize]byte Signature []byte PublicKey []byte MessageID uint32 Message []byte }
func SpoolRequestFromBytes ¶
func SpoolRequestFromBytes(raw []byte) (SpoolRequest, error)
func (*SpoolRequest) Encode ¶
func (s *SpoolRequest) Encode() ([]byte, error)
type SpoolResponse ¶
type SpoolResponse struct { SpoolID [SpoolIDSize]byte MessageID uint32 Message []byte Status string Padding []byte }
func SpoolResponseFromBytes ¶
func SpoolResponseFromBytes(raw []byte) (SpoolResponse, error)
func (*SpoolResponse) Encode ¶
func (s *SpoolResponse) Encode() ([]byte, error)
func (*SpoolResponse) IsOK ¶ added in v0.0.2
func (s *SpoolResponse) IsOK() bool
func (*SpoolResponse) StatusAsError ¶ added in v0.0.2
func (s *SpoolResponse) StatusAsError() error
Click to show internal directories.
Click to hide internal directories.