restapiprovider

package
v0.0.0-...-a193200 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPetRequest

type AddPetRequest struct {
	Type  string `json:"type"`
	Breed string `json:"breed"`
	Risk  int32  `json:"risk"`
}

type GetPetRequest

type GetPetRequest struct {
	Type  string `json:"type"`
	Breed string `json:"breed"`
}

type Pets

type Pets struct {
	Id    string `json:"_id"`
	Type  string `json:"type"`
	Breed string `json:"breed"`
	Risk  int32  `json:"risk"`
}

Pets holds the pet attributes used in a GetPetResponse.

type Service

type Service struct {
	AppSpec app.Spec
}

Service holds the RESTAPIProvider Service attributes.

func (*Service) AddPet

func (s *Service) AddPet(req AddPetRequest) error

AddPet ...

func (*Service) GetPet

func (s *Service) GetPet(req GetPetRequest) (*Pets, error)

GetPet executes a call to RESTAPIProvider's Get Pets API.

func (*Service) GetPets

func (s *Service) GetPets() ([]*Pets, error)

GetPets executes a call to RESTAPIProvider's Get Pets API.

type Servicer

type Servicer interface {
	GetPet(GetPetRequest) (*Pets, error)
	GetPets() ([]*Pets, error)
	AddPet(AddPetRequest) error
}

Servicer provides the transport-agnostic API for RESTAPIProvider.

Jump to

Keyboard shortcuts

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