storage

package
v0.0.0-...-a39b735 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package storage stores application data.

Package storage stores application data.

Package storage stores application data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB contains the storage data and methods.

func New

func New() *DB

New creates and runs the server.

func (*DB) AddPet

func (db *DB) AddPet(name string, tag *string) (int64, error)

AddPet saves a pet.

func (*DB) Close

func (db *DB) Close()

Close releases the database.

func (*DB) DeletePet

func (db *DB) DeletePet(id int64) error

DeletePet saves a pet.

func (*DB) FindPetByID

func (db *DB) FindPetByID(id int64) (api.Pet, error)

FindPetByID saves a pet.

func (*DB) FindPets

func (db *DB) FindPets(params api.FindPetsParams) ([]api.Pet, error)

FindPets saves a pet.

type Storer

type Storer interface {
	Close()
	AddPet(name string, tag *string) (int64, error)
	DeletePet(id int64) error
	FindPetByID(id int64) (api.Pet, error)
	FindPets(params api.FindPetsParams) ([]api.Pet, error)
}

Storer is the storage interface.

Jump to

Keyboard shortcuts

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