post

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadPostMeta specifies the error of bad post meta
	ErrBadPostMeta = errors.New("bad post meta")
)

Functions

This section is empty.

Types

type Post

type Post struct {
	PKey    [12]byte
	Owner   uint32
	Crtime  uint32
	Modtime uint32
	Status  uint8
	Alias   string
	Tags    []string
	KV      map[string][]byte
}

A Post specifies a post of postdb.

func FromBytes

func FromBytes(data []byte) (post *Post, err error)

FromBytes parses a post from bytes.

func New

func New() *Post

New returns a new post.

func (*Post) Bytes

func (p *Post) Bytes() []byte

Bytes returns the bytes of the post structure. data structure: "POST"(4) | version(1) | pkey(12) | owner(4) | crtime(4) | modtime(4)| status(1) | aliasLen(1) | tagsLen(1) | alias(aliasLen) | tags([1+tagLen]*N) | checksum(1)

func (*Post) Clone

func (p *Post) Clone() *Post

Clone clones the post

func (*Post) ID

func (p *Post) ID() string

Jump to

Keyboard shortcuts

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