posts

package
v0.0.0-...-8577a5a Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormID         = "id"
	FormTag        = "tag"
	FormUntag      = "untag"
	FormPermission = "permission"
)
View Source
const MaxThumbSize = 320

Variables

View Source
var CookieName = "posts-settings"

Functions

func Mount

func Mount(muxer render.Muxer) http.Handler

Types

type Int64Set

type Int64Set map[int64]struct{}

Int64Set represents an unordered set of int64s.

func (Int64Set) MarshalJSON

func (s Int64Set) MarshalJSON() ([]byte, error)

func (Int64Set) Set

func (s Int64Set) Set(i64 int64)

func (*Int64Set) UnmarshalJSON

func (s *Int64Set) UnmarshalJSON(b []byte) error

type JobError

type JobError struct {
	PostID  int64
	Message string
	Err     error
}

func (JobError) Error

func (err JobError) Error() string

type State

type State struct {
	Permission smolboard.Permission `json:"permission"` // -1 == skip
	Selections Int64Set             `json:"selections"`
	Tags       StringSet            `json:"tags"`
}

func NewState

func NewState() State

func UnmarshalState

func UnmarshalState(r *render.Request) (State, error)

func (State) MarshalCookie

func (s State) MarshalCookie() (string, error)

func (State) PostIsSelected

func (s State) PostIsSelected(p smolboard.Post) bool

type StringSet

type StringSet map[string]struct{}

StringSet represents an unordered set of strings.

func (StringSet) MarshalJSON

func (s StringSet) MarshalJSON() ([]byte, error)

func (StringSet) Set

func (s StringSet) Set(str string)

func (StringSet) Sorted

func (s StringSet) Sorted() []string

func (*StringSet) UnmarshalJSON

func (s *StringSet) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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