getpost

package
v0.0.0-...-cf27a83 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCommentsAwaitingModeration = 5

Variables

View Source
var (
	ErrNotFound = errorstate.Single(&errorstate.Detail{
		Domain:   "posts",
		Type:     "summary",
		Location: "post",
		Reason:   "not found",
		Message:  "The post cannot be found.",
	})
)

Functions

This section is empty.

Types

type Permissions

type Permissions struct {
	CreateComment bool `json:"create_comment"`
}

type Request

type Request struct {
	Slug      string
	Fields    string
	Principal security.Principal
}

func (*Request) Validate

func (req *Request) Validate() error

type Response

type Response struct {
	*post.Post

	Permissions *Permissions    `json:"permissions,omitempty"`
	Comments    []*post.Comment `json:"comments,omitempty"`
}

func Process

func Process(req *Request) (*Response, error)

Jump to

Keyboard shortcuts

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