mysql

package
v0.0.0-...-2f7ad66 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(config Config) (*sqlx.DB, error)

Types

type Config

type Config interface {
	Host() string
	Port() int
	DBName() string
	User() string
	Password() string
}

type TodoAccess

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

func NewTodoAccess

func NewTodoAccess(db *sqlx.DB) *TodoAccess

func (*TodoAccess) Create

func (a *TodoAccess) Create(ctx context.Context, todo *entity.Todo) error

func (*TodoAccess) Delete

func (a *TodoAccess) Delete(ctx context.Context, id entity.TodoID) (bool, error)

func (*TodoAccess) Find

func (a *TodoAccess) Find(ctx context.Context, id entity.TodoID) (*entity.Todo, error)

func (*TodoAccess) List

func (a *TodoAccess) List(ctx context.Context) (entity.Todos, error)

func (*TodoAccess) Update

func (a *TodoAccess) Update(ctx context.Context, todo *entity.Todo) error

Jump to

Keyboard shortcuts

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