data

package
v0.0.0-...-014da05 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(db *sql.DB) Store

func (Store) CountPostComments

func (s Store) CountPostComments(postId int64) (int, error)

func (Store) CountPosts

func (s Store) CountPosts() (int, error)

func (Store) DeletePost

func (s Store) DeletePost(id int64) error

func (Store) DeletePostComment

func (s Store) DeletePostComment(commentId int64) error

func (Store) DeletePostLike

func (s Store) DeletePostLike(userId, postId int64) error

func (Store) DeleteTokensForUser

func (s Store) DeleteTokensForUser(userId int64, scope auth.Scope) error

func (Store) DeleteUser

func (s Store) DeleteUser(id int64) error

func (Store) GetComment

func (s Store) GetComment(postId, commentId int64) (*posts.Comment, error)

func (Store) GetPost

func (s Store) GetPost(id int64) (*posts.Post, error)

func (Store) GetUser

func (s Store) GetUser(id int64) (*auth.User, error)

func (Store) GetUserByUsername

func (s Store) GetUserByUsername(username string) (*auth.User, error)

func (Store) GetUserForToken

func (s Store) GetUserForToken(hash []byte, scope auth.Scope) (*auth.User, error)

func (Store) InsertPost

func (s Store) InsertPost(post *posts.Post) error

func (Store) InsertPostComment

func (s Store) InsertPostComment(comment *posts.Comment) error

func (Store) InsertPostLike

func (s Store) InsertPostLike(userId, postId int64) error

func (Store) InsertToken

func (s Store) InsertToken(token *auth.Token) error

func (Store) InsertUser

func (s Store) InsertUser(user *auth.User) error

func (Store) ListPostComments

func (s Store) ListPostComments(postId int64, limit, offset int) ([]*posts.Comment, error)

func (Store) ListPosts

func (s Store) ListPosts(limit, offset int) ([]*posts.Post, error)

func (Store) UpdatePost

func (s Store) UpdatePost(post *posts.Post) error

func (Store) UpdatePostComment

func (s Store) UpdatePostComment(comment *posts.Comment) error

Jump to

Keyboard shortcuts

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