postgres

package
v0.0.0-...-cf7c807 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentPostgres

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

func (*CommentPostgres) ListComments

func (c *CommentPostgres) ListComments(
	ctx context.Context,
	topicID string,
	limit, offset int,
) (result []model.Comment, total int, err error)

func (*CommentPostgres) NewComment

func (c *CommentPostgres) NewComment(ctx context.Context, comment model.Comment) (model.Comment, error)

type Postgres

type Postgres struct {
	*UserPostgres
	*TopicPostgres
	*CommentPostgres
	// contains filtered or unexported fields
}

func NewPostgres

func NewPostgres(db *sqlx.DB) *Postgres

func (*Postgres) MigrateUp

func (p *Postgres) MigrateUp() error

type TopicPostgres

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

func (*TopicPostgres) GetTopic

func (t *TopicPostgres) GetTopic(ctx context.Context, id string) (model.TopicDetailed, error)

func (*TopicPostgres) ListTopics

func (t *TopicPostgres) ListTopics(ctx context.Context, limit, offset int) ([]model.Topic, int, error)

func (*TopicPostgres) NewTopic

func (t *TopicPostgres) NewTopic(ctx context.Context, topic model.Topic) (model.Topic, error)

type UserPostgres

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

func (*UserPostgres) NewUser

func (u *UserPostgres) NewUser(ctx context.Context, user model.User) (model.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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