jsonable

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJsonableEntry

func ToJsonableEntry(e iface.IPFSLogEntry) interface{}

ToJsonableEntry creates a CBOR serializable version of an entry

Types

type Entry

type Entry struct {
	V        uint64
	LogID    string
	Key      string
	Sig      string
	Hash     interface{}
	Next     []cid.Cid
	Refs     []cid.Cid
	Clock    *LamportClock
	Payload  string
	Identity *Identity

	EncryptedLinks      string
	EncryptedLinksNonce string
}

Entry CBOR representable version of Entry

func (*Entry) ToPlain

func (c *Entry) ToPlain(out iface.IPFSLogEntry, provider identityprovider.Interface, newClock func() iface.IPFSLogLamportClock) error

ToPlain returns a plain Entry from a CBOR serialized version

type EntryV0

type EntryV0 struct {
	Hash    *string       `json:"hash"`
	ID      string        `json:"id"`
	Payload string        `json:"payload"`
	Next    []string      `json:"next"`
	V       uint64        `json:"v"`
	Clock   *LamportClock `json:"clock"`
	Key     string        `json:"key"`
	Sig     string        `json:"sig"`
}

EntryV0 CBOR representable version of Entry v0

func (*EntryV0) ToPlain

func (e *EntryV0) ToPlain(out iface.IPFSLogEntry, provider identityprovider.Interface, newClock func() iface.IPFSLogLamportClock) error

type EntryV1

type EntryV1 struct {
	V        uint64
	LogID    string
	Key      string
	Sig      string
	Hash     interface{}
	Next     []cid.Cid
	Clock    *LamportClock
	Payload  string
	Identity *Identity
}

EntryV1 CBOR representable version of Entry v1

type EntryV2

type EntryV2 = Entry

EntryV2 CBOR representable version of Entry v2

type Identity

type Identity struct {
	ID         string             `json:"id"`
	PublicKey  string             `json:"public_key"`
	Signatures *IdentitySignature `json:"signatures"`
	Type       string             `json:"type"`
}

func ToJsonableIdentity

func ToJsonableIdentity(id *identityprovider.Identity) *Identity

ToJsonableIdentity converts an identity to a CBOR serializable identity.

func (*Identity) ToPlain

ToPlain converts a CBOR serializable to a plain Identity object.

type IdentitySignature

type IdentitySignature struct {
	ID        string `json:"id"`
	PublicKey string `json:"public_key"`
}

func ToJsonableIdentitySignature

func ToJsonableIdentitySignature(id *identityprovider.IdentitySignature) *IdentitySignature

ToJsonableIdentitySignature converts to a CBOR serialized identity signature a plain IdentitySignature.

func (*IdentitySignature) ToPlain

ToPlain converts a CBOR serializable identity signature to a plain IdentitySignature.

type LamportClock

type LamportClock struct {
	ID   string `json:"id"`
	Time int    `json:"time"`
}

func ToJsonableLamportClock

func ToJsonableLamportClock(l iface.IPFSLogLamportClock) *LamportClock

func (*LamportClock) ToPlain

func (c *LamportClock) ToPlain(out iface.IPFSLogLamportClock) error

Jump to

Keyboard shortcuts

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