store

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearExpiredTrashPosts

func ClearExpiredTrashPosts() error

func ClearNavigations

func ClearNavigations() error

func ClearTrashPosts

func ClearTrashPosts() error

func CountPosts

func CountPosts(q *ListPostsQuery) (int, error)

func CountPostsByType

func CountPostsByType() (*entity.PostCount, error)

func CountPostsByUser

func CountPostsByUser(uid string) (int, error)

func CountTags

func CountTags(keyword string) (int, error)

func CreateNavigation

func CreateNavigation(n *entity.NavigationW) error

func CreatePost

func CreatePost(p *entity.PostW) error

func CreateTag

func CreateTag(t *entity.TagW) error

func CreateUser

func CreateUser(u *entity.UserW) error

func DeletePost

func DeletePost(id string) error

func DeletePostsByUser

func DeletePostsByUser(uid string) error

func DeleteTag

func DeleteTag(id string) error

func DeleteUser

func DeleteUser(id string) error

func GetNextPost

func GetNextPost(id string) (*entity.PostR, error)

func GetPost

func GetPost(id string) (*entity.PostR, error)

func GetPostBySlug

func GetPostBySlug(slug string) (*entity.PostR, error)

func GetPreviousPost

func GetPreviousPost(id string) (*entity.PostR, error)

func GetTag

func GetTag(id string) (*entity.TagR, error)

func GetTagBySlug

func GetTagBySlug(slug string) (*entity.TagR, error)

func GetTagsByName

func GetTagsByName(names []string) ([]*entity.TagR, error)

func GetUser

func GetUser(id string) (*entity.UserR, error)

func GetUserByEmail

func GetUserByEmail(email string) (*entity.UserR, error)

func IsNotFound

func IsNotFound(err error) bool

func ListMostUsedTags

func ListMostUsedTags() ([]*entity.TagR, error)

func ListNavigations

func ListNavigations() ([]*entity.NavigationR, error)

func ListPostDates

func ListPostDates() (data []string, err error)

func ListPosts

func ListPosts(q *ListPostsQuery) ([]*entity.PostR, error)

func ListTags

func ListTags(offset, limit int, keyword string) ([]*entity.TagR, error)

func ListTagsByPost

func ListTagsByPost(id string) ([]*entity.TagR, error)

func ListUsers

func ListUsers() ([]*entity.UserR, error)

func PtrBool

func PtrBool(b bool) *bool

func TransferPosts

func TransferPosts(fromUID, toUID string) error

func TrashPost

func TrashPost(id string) error

func UntrashPost

func UntrashPost(id string) error

func UpdatePost

func UpdatePost(p *entity.PostW) error

func UpdateTag

func UpdateTag(t *entity.TagW) error

func UpdateUser

func UpdateUser(id, nickname, bio, email string) error

func UpdateUserPassword

func UpdateUserPassword(id, password string) error

func UserExists

func UserExists(id string) (bool, error)

func UserNicknameExists added in v1.0.2

func UserNicknameExists(nickname string) (bool, error)

Types

type ListPostsQuery

type ListPostsQuery struct {
	AuthorID       string
	TagID          string
	Title          string
	Query          string
	Visibilities   []entity.Visibility
	IsPublished    *bool
	IsTrashed      *bool
	PublishedYear  string
	PublishedMonth string
	PublishedDay   string
	PublishedDate  string
	Offset         int
	Limit          int
}

func (*ListPostsQuery) Build

func (q *ListPostsQuery) Build() (query string, args []any)

Jump to

Keyboard shortcuts

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