petstore

package
v1.23.10 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pets = []Pet{
	{ID: 1, Name: "Dog", PhotoURLs: []string{}, Status: "available", Tags: nil},
	{ID: 2, Name: "Cat", PhotoURLs: []string{}, Status: "pending", Tags: nil},
}

Functions

func AddPet

func AddPet(pet Pet)

func RemovePet

func RemovePet(id int64)

Types

type Pet

type Pet struct {
	ID        int64    `json:"id"`
	Name      string   `json:"name"`
	PhotoURLs []string `json:"photoUrls,omitempty"`
	Status    string   `json:"status,omitempty"`
	Tags      []Tag    `json:"tags,omitempty"`
	Child     *Pet     `json:"child"`
	CHilds    []*Pet   `json:"childs"`
}

Pet the pet model.

func PetByID

func PetByID(id int64) (*Pet, error)

type PetDTO

type PetDTO struct {
	Name      string   `json:"name"`
	PhotoURLs []string `json:"photoUrls,omitempty"`
	Status    string   `json:"status,omitempty"`
	Tags      []Tag    `json:"tags,omitempty"`
}

PetDTO the pet dto.

type Tag

type Tag struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

Tag the tag model.

Jump to

Keyboard shortcuts

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