postops

package
v0.0.0-...-8989e0a Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePost

func DeletePost(ctx context.Context, exec boil.ContextExecutor, postID string) error

func DeserializeArchive

func DeserializeArchive(b []byte) ([]*core.Post, map[string][]byte, error)

func DeserializePost

func DeserializePost(b []byte) (*core.Post, error)

func SerializeBlog

func SerializeBlog(ctx context.Context, exec boil.ContextExecutor, mediaServer media.MediaServer, userID string, m ...qm.QueryMod) ([]byte, error)

func SerializePost

func SerializePost(post *core.Post) []byte

Types

type Comment

type Comment struct {
	*core.PostComment
	Author       *core.User
	Capabilities *CommentCapabilities
	Level        int64
}

func ConstructComments

func ConstructComments(comments core.PostCommentSlice, radius userops.ConnectionRadius) []*Comment

func (*Comment) String

func (c *Comment) String() string

type CommentCapabilities

type CommentCapabilities struct {
	CanRespond bool
}

type ExportField

type ExportField string
const (
	OriginalID  ExportField = "original_id"
	Subject     ExportField = "subject"
	Visibility  ExportField = "visibility"
	PublishDate ExportField = "published"
)

type InjectStats

type InjectStats struct {
	PostsCreated   int
	PostsUpdated   int
	ImagesUploaded int
	ImagesSkipped  int
}

func InjectPostsInDB

func InjectPostsInDB(ctx context.Context, exec boil.ContextExecutor, mediaServer media.MediaServer, userID string, posts []*core.Post, images map[string][]byte) (*InjectStats, error)

type Post

type Post struct {
	*core.Post
	Author         *core.User
	Capabilities   *PostCapabilities
	CommentsNumber int64
	Comments       []*Comment
	EditPreview    bool
}

func ConstructPost

func ConstructPost(user *core.User, post *core.Post, radius userops.ConnectionRadius, editPreview bool) *Post

func (*Post) IsPublished

func (p *Post) IsPublished() bool

func (*Post) PostSubject

func (p *Post) PostSubject() string

type PostCapabilities

type PostCapabilities struct {
	CanViewComments  bool
	CanLeaveComments bool
	CanEdit          bool
}

func GetPostCapabilities

func GetPostCapabilities(userID string, authorID string, radius userops.ConnectionRadius) *PostCapabilities

Jump to

Keyboard shortcuts

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