database

package
v0.0.0-...-6d63a71 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("not found")
	ErrBadRequest = errors.New("bad request")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	CreatePet(ctx context.Context, pet model.NewPet) (string, error)
	GetPet(ctx context.Context, id string) (model.Pet, error)
	Close() error
}

func ConnectMongoDB

func ConnectMongoDB(ctx context.Context, uri, db string) (Client, error)

type MongoDBClient

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

func (*MongoDBClient) Close

func (c *MongoDBClient) Close() error

func (*MongoDBClient) CreatePet

func (c *MongoDBClient) CreatePet(ctx context.Context, pet model.NewPet) (string, error)

func (*MongoDBClient) GetPet

func (c *MongoDBClient) GetPet(ctx context.Context, id string) (model.Pet, error)

Jump to

Keyboard shortcuts

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