Documentation ¶
Overview ¶
Package payload is a generated protocol buffer package.
It is generated from these files:
payload/payload.proto payload/attached.proto payload/detached.proto
It has these top-level messages:
Envelope
Index ¶
- Variables
- func Marshal(p Payload) ([]byte, error)
- type Attached
- func (p *Attached) Digest() ([]byte, error)
- func (p *Attached) Lock(r io.Reader, db material.DB) ([]byte, error)
- func (m *Attached) Marshal() (data []byte, err error)
- func (m *Attached) MarshalTo(data []byte) (int, error)
- func (*Attached) ProtoMessage()
- func (m *Attached) Reset()
- func (m *Attached) Size() (n int)
- func (m *Attached) String() string
- func (p *Attached) Unlock(w io.Writer, ks []byte, db material.DB) error
- func (m *Attached) Unmarshal(data []byte) error
- type Detached
- func (p *Detached) Digest() ([]byte, error)
- func (p *Detached) Lock(r io.Reader, db material.DB) ([]byte, error)
- func (m *Detached) Marshal() (data []byte, err error)
- func (m *Detached) MarshalTo(data []byte) (int, error)
- func (*Detached) ProtoMessage()
- func (m *Detached) Reset()
- func (m *Detached) Size() (n int)
- func (m *Detached) String() string
- func (p *Detached) Unlock(w io.Writer, ks []byte, db material.DB) error
- func (m *Detached) Unmarshal(data []byte) error
- type Envelope
- func (m *Envelope) GetAttached() *Attached
- func (m *Envelope) GetDetached() *Detached
- func (this *Envelope) GetValue() interface{}
- func (m *Envelope) Marshal() (data []byte, err error)
- func (m *Envelope) MarshalTo(data []byte) (int, error)
- func (e *Envelope) Payload() (Payload, error)
- func (*Envelope) ProtoMessage()
- func (m *Envelope) Reset()
- func (this *Envelope) SetValue(value interface{}) bool
- func (m *Envelope) Size() (n int)
- func (m *Envelope) String() string
- func (m *Envelope) Unmarshal(data []byte) error
- type Payload
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLengthAttached = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
ErrInvalidLengthDetached = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
ErrInvalidLengthPayload = fmt.Errorf("proto: negative length found during unmarshaling")
)
Functions ¶
Types ¶
type Attached ¶
type Attached struct { Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` }
func (*Attached) Lock ¶
Lock encrypts the data from r using the secretbox encryption scheme from NaCl and returns the secret key.
func (*Attached) ProtoMessage ¶
func (*Attached) ProtoMessage()
type Detached ¶
type Detached struct { Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // contains filtered or unexported fields }
func (*Detached) Lock ¶
Lock encrypts the data from r using the secretbox encryption scheme from NaCl. The nonce & ciphertext are stored in the DB and the secret key is returned.
func (*Detached) ProtoMessage ¶
func (*Detached) ProtoMessage()
type Envelope ¶
type Envelope struct { Attached *Attached `protobuf:"bytes,1,opt,name=attached" json:"attached,omitempty"` Detached *Detached `protobuf:"bytes,2,opt,name=detached" json:"detached,omitempty"` }
func (*Envelope) GetAttached ¶
func (*Envelope) GetDetached ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
type Payload ¶
type Payload interface { // Digest is a unique series of bytes that identify the Payload. Digest() ([]byte, error) // Lock encrypts the data from the Reader and returns ciphertext. Lock(io.Reader, material.DB) ([]byte, error) // Unlock decrypts the ciphertext and writes the data to the Writer. Unlock(io.Writer, []byte, material.DB) error // Marshal returns the binary representation of the Payload. Marshal() ([]byte, error) // Unmarshal parses the Payload encoded in data. Unmarshal([]byte) error }
Payload encrypts and stores the data for a vault.
Click to show internal directories.
Click to hide internal directories.