postgres

package
v0.0.0-...-5308550 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: AGPL-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 (*CommentStore) Comment

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

func (*CommentStore) CommentsByPost

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

func (*CommentStore) CreateComment

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

func (*CommentStore) DeleteComment

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

func (*CommentStore) UpdateComment

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

type PostStore

type PostStore struct {
	*sqlx.DB
}

func (*PostStore) CreatePost

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

func (*PostStore) DeletePost

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

func (*PostStore) Post

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

func (*PostStore) Posts

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

func (*PostStore) PostsByThread

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

func (*PostStore) UpdatePost

func (s *PostStore) UpdatePost(p *goddit.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 (*ThreadStore) CreateThread

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

func (*ThreadStore) DeleteThread

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

func (*ThreadStore) Thread

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

func (*ThreadStore) Threads

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

func (*ThreadStore) UpdateThread

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

type UserStore

type UserStore struct {
	*sqlx.DB
}

func (*UserStore) CreateUser

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

func (*UserStore) DeleteUser

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

func (*UserStore) UpdateUser

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

func (*UserStore) User

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

func (*UserStore) UserByUsername

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

func (*UserStore) Users

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

Jump to

Keyboard shortcuts

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