post

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPost

type IPost interface {
	ToForm() *url.Values
	ToJSON() ([]byte, error)
}

IPost The representation of a post

type Post

type Post struct {
	microformats.Microformat
}

Post The representation of a post

func FromForm added in v0.8.0

func FromForm(values *url.Values) (*Post, error)

FromForm Create a Post from a given set of url.Values, such as:

&url.Values{"h": {"entry"}, "category": {"foo"}}

Best used when parsing the incoming HTTP request

func FromStrings

func FromStrings(args []string) (*Post, error)

FromStrings Create a Post from a given set of key-value arguments, such as:

[]string{"h=entry", "category=bar", "category[]=baz"}

func (Post) ToForm

func (p Post) ToForm() *url.Values

ToForm Convert the given Post to a the form-encoded format of the post

func (Post) ToJSON added in v0.8.0

func (p Post) ToJSON() ([]byte, error)

ToJSON Convert the given Post to a the JSON format of the post

Jump to

Keyboard shortcuts

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