postgres

package
v0.0.0-...-5b0fdc6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentStore

type CommentStore struct {
	*sqlx.DB
}

func NewCommentStore

func NewCommentStore(db *sqlx.DB) *CommentStore

func (*CommentStore) Comment

func (s *CommentStore) Comment(id uuid.UUID) (godiscuss.Comment, error)

func (*CommentStore) CommentsByPost

func (s *CommentStore) CommentsByPost(postID uuid.UUID) ([]godiscuss.Comment, error)

func (*CommentStore) CreateComment

func (s *CommentStore) CreateComment(c *godiscuss.Comment) error

func (*CommentStore) DeleteComment

func (s *CommentStore) DeleteComment(id uuid.UUID) error

func (*CommentStore) UpdateComment

func (s *CommentStore) UpdateComment(c *godiscuss.Comment) error

type PostStore

type PostStore struct {
	*sqlx.DB
}

func NewPostStore

func NewPostStore(db *sqlx.DB) *PostStore

func (*PostStore) CreatePost

func (s *PostStore) CreatePost(p *godiscuss.Post) error

func (*PostStore) DeletePost

func (s *PostStore) DeletePost(id uuid.UUID) error

func (*PostStore) Post

func (s *PostStore) Post(id uuid.UUID) (godiscuss.Post, error)

func (*PostStore) Posts

func (s *PostStore) Posts() ([]godiscuss.Post, error)

func (*PostStore) PostsByThread

func (s *PostStore) PostsByThread(threadID uuid.UUID) ([]godiscuss.Post, error)

func (*PostStore) UpdatePost

func (s *PostStore) UpdatePost(p *godiscuss.Post) error

type Store

type Store struct {
	*ThreadStore
	*PostStore
	*CommentStore
	*UserStore
}

func NewStore

func NewStore(dataSourceName string) (*Store, error)

type ThreadStore

type ThreadStore struct {
	*sqlx.DB
}

func NewThreadStore

func NewThreadStore(db *sqlx.DB) *ThreadStore

func (*ThreadStore) CreateThread

func (s *ThreadStore) CreateThread(t *godiscuss.Thread) error

func (*ThreadStore) DeleteThread

func (s *ThreadStore) DeleteThread(id uuid.UUID) error

func (*ThreadStore) Thread

func (s *ThreadStore) Thread(id uuid.UUID) (godiscuss.Thread, error)

func (*ThreadStore) Threads

func (s *ThreadStore) Threads() ([]godiscuss.Thread, error)

func (*ThreadStore) UpdateThread

func (s *ThreadStore) UpdateThread(t *godiscuss.Thread) error

type UserStore

type UserStore struct {
	*sqlx.DB
}

func NewUserStore

func NewUserStore(db *sqlx.DB) *UserStore

func (*UserStore) CreateUser

func (s *UserStore) CreateUser(u *godiscuss.User) error

func (*UserStore) DeleteUser

func (s *UserStore) DeleteUser(id uuid.UUID) error

func (*UserStore) UpdateUser

func (s *UserStore) UpdateUser(u *godiscuss.User) error

func (*UserStore) User

func (s *UserStore) User(id uuid.UUID) (godiscuss.User, error)

func (*UserStore) UserByUsername

func (s *UserStore) UserByUsername(username string) (godiscuss.User, error)

func (*UserStore) Users

func (s *UserStore) Users() ([]godiscuss.User, error)

Jump to

Keyboard shortcuts

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