store

package
v0.0.0-...-d0177a8 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	MustExec(query string, args ...interface{}) sql.Result
	NamedQuery(query string, args interface{}) (*sqlx.Rows, error)
	NamedExec(query string, args interface{}) (sql.Result, error)
	Select(dest interface{}, query string, args ...interface{}) error
	Get(dest interface{}, query string, args ...interface{}) error
}

type Store

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

func New

func New(db DB) *Store

func (*Store) GetPost

func (s *Store) GetPost(id string) (*model.Post, error)

func (*Store) GetPosts

func (s *Store) GetPosts(subreddit string) ([]*model.Post, error)

func (*Store) InsertPost

func (s *Store) InsertPost(post *model.Post) (*model.Post, error)

Jump to

Keyboard shortcuts

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