pet

package
v0.0.0-...-2bea0bf Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffPhotos

func DiffPhotos(spec []string, current []string) (addPhotoUrls []string, remove []string)

func DiffTags

func DiffTags(spec []v1alpha1.PetTag, current []Tag) (addTags []Tag, remove []Tag)

func GeneratePetStatus

func GeneratePetStatus(pet *Pet) v1alpha1.PetObservation

func IsPetUptodate

func IsPetUptodate(p v1alpha1.PetParameters, cd *Pet) bool

func IsPhotosUrlUptodate

func IsPhotosUrlUptodate(p v1alpha1.PetParameters, cd *Pet) bool

func IsTagsUptodate

func IsTagsUptodate(p v1alpha1.PetParameters, cd *Pet) bool

Types

type Category

type Category struct {
	Id   *int64  `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

type Client

type Client interface {
	AddPet(pet *Pet) (*Pet, error)
	GetPetById(petId string) (*Pet, error)
	UpdatePetById(petId string, pet *Pet) error
	DeletePetById(petId string) error
}

func NewClient

func NewClient(cfg *petstore.Config) Client

type Pet

type Pet struct {
	Category  *Category `json:"category,omitempty"`
	Id        *int64    `json:"id,omitempty"`
	Name      string    `json:"name"`
	PhotoUrls []string  `json:"photoUrls"`
	Status    PetStatus `json:"status,omitempty"`
	Tags      *[]Tag    `json:"tags,omitempty"`
}

func GeneratePet

func GeneratePet(p v1alpha1.PetParameters) *Pet

type PetClient

type PetClient struct {
	*petstore.Client
}

func New

func New(cfg *petstore.Config) PetClient

func (*PetClient) AddPet

func (c *PetClient) AddPet(pet *Pet) (*Pet, error)

func (*PetClient) DeletePetById

func (c *PetClient) DeletePetById(petId string) error

func (*PetClient) GetPetById

func (c *PetClient) GetPetById(petId string) (*Pet, error)

func (*PetClient) UpdatePetById

func (c *PetClient) UpdatePetById(petId string, pet *Pet) error

type PetStatus

type PetStatus string
const (
	PetStatusPending    PetStatus = "PENDING"
	PetStatusAvailable  PetStatus = "AVAILABLE"
	PetStatusInProgress PetStatus = "INPROGRESS"
	PetStatusInactive   PetStatus = "INACTIVE"
	PetStatusFailed     PetStatus = "FAILED"
)

type Tag

type Tag struct {
	Id   *int64  `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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