repository

package
v0.0.0-...-246a067 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 4 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 *gorm.DB) *GopherRepository

NewGopherRepository returns a new GopherRepository.

func (*GopherRepository) Create

func (r *GopherRepository) Create(ctx context.Context, gopher *model.Gopher) error

Create creates a new model.Gopher.

func (*GopherRepository) Delete

func (r *GopherRepository) Delete(ctx context.Context, gopher *model.Gopher) error

Delete deletes an existing model.Gopher.

func (*GopherRepository) Find

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

Find finds a model.Gopher by id.

func (*GopherRepository) FindAll

func (r *GopherRepository) FindAll(ctx context.Context) ([]model.Gopher, error)

FindAll finds all model.Gopher.

func (*GopherRepository) Update

func (r *GopherRepository) Update(ctx context.Context, gopher *model.Gopher, update *model.Gopher) error

Update updates an existing model.Gopher.

Jump to

Keyboard shortcuts

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