addcomment

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

	ErrForbidden = errorstate.Single(&errorstate.Detail{
		Domain:   "posts",
		Type:     "summary",
		Location: "add post comment",
		Reason:   "forbidded",
		Message:  "Unauthorized to add comment to post.",
	})

	ErrTooManyComments = errorstate.Single(&errorstate.Detail{
		Domain:   "posts",
		Type:     "summary",
		Location: "add post comment",
		Reason:   "too many comments",
		Message: "There are too many of your comments awaiting moderation. " +
			"Come back later, please.",
	})

	ErrFailed = errorstate.Single(&errorstate.Detail{
		Domain:   "posts",
		Type:     "summary",
		Location: "add post comment",
		Reason:   "failed",
		Message:  "We're sorry... the comment cannot be added.",
	})
)

Functions

func Process

func Process(req *Request) error

Types

type Request

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

func (*Request) Validate

func (req *Request) Validate() error

type Response

type Response struct {
}

Jump to

Keyboard shortcuts

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