repository

package
v0.0.0-...-ea17066 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 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 GopherRepository

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

GopherRepository is the repository to handle the model.Gopher model database interactions.

func NewGopherRepository

func NewGopherRepository(db *sql.DB) *GopherRepository

NewGopherRepository returns a new GopherRepository.

func (*GopherRepository) Create

Create creates a new gopher and returns its id.

func (*GopherRepository) Delete

func (r *GopherRepository) Delete(ctx context.Context, id int) error

Delete deletes an existing gopher by id.

func (*GopherRepository) Find

func (r *GopherRepository) Find(ctx context.Context, id int) (model.Gopher, error)

Find finds a gopher by id.

func (*GopherRepository) FindAll

FindAll finds all gophers.

type GopherRepositoryCreateParams

type GopherRepositoryCreateParams struct {
	Name string
	Job  sql.NullString
}

GopherRepositoryCreateParams is a parameter for Create.

type GopherRepositoryFindAllParams

type GopherRepositoryFindAllParams struct {
	Name sql.NullString
	Job  sql.NullString
}

GopherRepositoryFindAllParams is a parameter for FindAll.

Jump to

Keyboard shortcuts

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