db

package
v0.0.0-...-a0e5b65 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close - Closes repository connection

func InsertMeow

func InsertMeow(ctx context.Context, meow schema.Meow) error

InsertMeow - InsertMeow implementation

func ListMeow

func ListMeow(ctx context.Context, skip uint64, take uint64) ([]schema.Meow, error)

ListMeow - InsertMeow implementation

func SetRepository

func SetRepository(repository Repository)

SetRepository - set the repository connection

Types

type PostgresRepository

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

PostgresRepository postgres implementation for Repository interface

func NewPostgres

func NewPostgres(url string) (*PostgresRepository, error)

NewPostgres creates database connection with Postgres

func (*PostgresRepository) Close

func (r *PostgresRepository) Close()

Close postgres connection

func (*PostgresRepository) InsertMeow

func (r *PostgresRepository) InsertMeow(ctx context.Context, meow schema.Meow) error

InsertMeow inserts Meow

func (*PostgresRepository) ListMeows

func (r *PostgresRepository) ListMeows(ctx context.Context, skip uint64, take uint64) ([]schema.Meow, error)

ListMeows lists Meow

type Repository

type Repository interface {
	Close()
	InsertMeow(ctx context.Context, meow schema.Meow) error
	ListMeows(ctx context.Context, skip uint64, take uint64) ([]schema.Meow, error)
}

Repository interface for Command services

Jump to

Keyboard shortcuts

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