envelope

package
v0.1.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package envelope defines the generic encapsulating format for Arigato objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope interface {
	GetID() *identity.ID // avoid field collision
}

Envelope is the interface implemented by objects that encapsulate 'true' Arigato objects.

type Signed

type Signed struct {
	ID        *identity.ID          `json:"id"`
	Version   uint8                 `json:"version"`
	Body      identity.Identifiable `json:"body"`
	Signature primitive.Signature   `json:"sig"`
}

Signed is the generic format for encapsulating signed immutable request/response objects to/from arigato.

func (*Signed) GetID

func (e *Signed) GetID() *identity.ID

GetID returns the ID of the object encapsulated in this envelope.

func (*Signed) UnmarshalJSON

func (e *Signed) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Signed envelopes.

type Unsigned

type Unsigned struct {
	ID      *identity.ID          `json:"id"`
	Version uint8                 `json:"version"`
	Body    identity.Identifiable `json:"body"`
}

Unsigned is the generic format for encapsulating unsigned mutable request/response objects to/from arigato.

func (*Unsigned) GetID

func (e *Unsigned) GetID() *identity.ID

GetID returns the ID of the object encapsulated in this envelope.

func (*Unsigned) UnmarshalJSON

func (e *Unsigned) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Unsigned envelopes.

Jump to

Keyboard shortcuts

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