post

package
v0.0.0-...-bda66fc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: ISC Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Content   string          `json:"content"`
	Pubkey    *openpgp.Entity `msg:"-" json:"-"`
	PubkeyStr string          `json:"pubkey"`
	Signature string          `json:"signature"`
	Timestamp int64           `json:"date"`
}

Post contains all information needed for a complete post representation

func (*Post) DecodeMsg

func (z *Post) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Post) Deserialize

func (p *Post) Deserialize(bts []byte) error

Deserialize implements tangle/datastore.serializable

func (*Post) EncodeMsg

func (z *Post) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Post) Hash

func (p *Post) Hash() (hash.Hash, error)

Hash returns the hashed post for storage

func (*Post) JSON

func (p *Post) JSON() error

JSON prepares for json encoding

func (*Post) MarshalMsg

func (z *Post) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Post) Msgsize

func (z *Post) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Post) ReInit

func (p *Post) ReInit() error

ReInit restores the original field after serialization

func (*Post) Serialize

func (p *Post) Serialize() ([]byte, error)

Serialize implements tangle/datastore.serializable

func (*Post) Type

func (p *Post) Type() string

Type implements tangle/datastore.serializable

func (*Post) UnmarshalMsg

func (z *Post) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Post) Verify

func (p *Post) Verify() (*openpgp.Entity, error)

Verify returns no error when the signature is valid

Jump to

Keyboard shortcuts

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