pets

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

View Source
var File_proto_v1beta1_pets_pets_api_proto protoreflect.FileDescriptor
View Source
var PetsAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pets.PetsAPI",
	HandlerType: (*PetsAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPet",
			Handler:    _PetsAPI_GetPet_Handler,
		},
		{
			MethodName: "GetPets",
			Handler:    _PetsAPI_GetPets_Handler,
		},
		{
			MethodName: "AddPet",
			Handler:    _PetsAPI_AddPet_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/v1beta1/pets/pets_api.proto",
}

PetsAPI_ServiceDesc is the grpc.ServiceDesc for PetsAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPetsAPIServer

func RegisterPetsAPIServer(s grpc.ServiceRegistrar, srv PetsAPIServer)

Types

type AddPetRequest

type AddPetRequest struct {
	Type  string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Breed string `protobuf:"bytes,2,opt,name=breed,proto3" json:"breed,omitempty"`
	Risk  int32  `protobuf:"varint,3,opt,name=risk,proto3" json:"risk,omitempty"`
	// contains filtered or unexported fields
}

AddPetRequest defines the request for adding a pet to a database of pets.

func (*AddPetRequest) Descriptor deprecated

func (*AddPetRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddPetRequest.ProtoReflect.Descriptor instead.

func (*AddPetRequest) GetBreed

func (x *AddPetRequest) GetBreed() string

func (*AddPetRequest) GetRisk

func (x *AddPetRequest) GetRisk() int32

func (*AddPetRequest) GetType

func (x *AddPetRequest) GetType() string

func (*AddPetRequest) ProtoMessage

func (*AddPetRequest) ProtoMessage()

func (*AddPetRequest) ProtoReflect

func (x *AddPetRequest) ProtoReflect() protoreflect.Message

func (*AddPetRequest) Reset

func (x *AddPetRequest) Reset()

func (*AddPetRequest) String

func (x *AddPetRequest) String() string

type AddPetResponse

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

AddPetResponse defines the response for adding a pet to a database of pets.

func (*AddPetResponse) Descriptor deprecated

func (*AddPetResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddPetResponse.ProtoReflect.Descriptor instead.

func (*AddPetResponse) ProtoMessage

func (*AddPetResponse) ProtoMessage()

func (*AddPetResponse) ProtoReflect

func (x *AddPetResponse) ProtoReflect() protoreflect.Message

func (*AddPetResponse) Reset

func (x *AddPetResponse) Reset()

func (*AddPetResponse) String

func (x *AddPetResponse) String() string

type GetPetRequest

type GetPetRequest struct {
	Type  string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Breed string `protobuf:"bytes,2,opt,name=breed,proto3" json:"breed,omitempty"`
	// contains filtered or unexported fields
}

GetPetRequest defines the request for fetching a pet by type/breed from a database of pets.

func (*GetPetRequest) Descriptor deprecated

func (*GetPetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetPetRequest.ProtoReflect.Descriptor instead.

func (*GetPetRequest) GetBreed

func (x *GetPetRequest) GetBreed() string

func (*GetPetRequest) GetType

func (x *GetPetRequest) GetType() string

func (*GetPetRequest) ProtoMessage

func (*GetPetRequest) ProtoMessage()

func (*GetPetRequest) ProtoReflect

func (x *GetPetRequest) ProtoReflect() protoreflect.Message

func (*GetPetRequest) Reset

func (x *GetPetRequest) Reset()

func (*GetPetRequest) String

func (x *GetPetRequest) String() string

type GetPetResponse

type GetPetResponse struct {
	Pet         *Pet                   `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"`
	LastUpdated *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	// contains filtered or unexported fields
}

GetPetResponse defines the response for fetching a pet by type/breed from a database of pets.

func (*GetPetResponse) Descriptor deprecated

func (*GetPetResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetPetResponse.ProtoReflect.Descriptor instead.

func (*GetPetResponse) GetLastUpdated

func (x *GetPetResponse) GetLastUpdated() *timestamppb.Timestamp

func (*GetPetResponse) GetPet

func (x *GetPetResponse) GetPet() *Pet

func (*GetPetResponse) ProtoMessage

func (*GetPetResponse) ProtoMessage()

func (*GetPetResponse) ProtoReflect

func (x *GetPetResponse) ProtoReflect() protoreflect.Message

func (*GetPetResponse) Reset

func (x *GetPetResponse) Reset()

func (*GetPetResponse) String

func (x *GetPetResponse) String() string

type GetPetsRequest

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

GetPetsRequest defines the request for fetching all pets from a database of pets.

func (*GetPetsRequest) Descriptor deprecated

func (*GetPetsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetPetsRequest.ProtoReflect.Descriptor instead.

func (*GetPetsRequest) ProtoMessage

func (*GetPetsRequest) ProtoMessage()

func (*GetPetsRequest) ProtoReflect

func (x *GetPetsRequest) ProtoReflect() protoreflect.Message

func (*GetPetsRequest) Reset

func (x *GetPetsRequest) Reset()

func (*GetPetsRequest) String

func (x *GetPetsRequest) String() string

type GetPetsResponse

type GetPetsResponse struct {
	Pet []*Pet `protobuf:"bytes,1,rep,name=pet,proto3" json:"pet,omitempty"` // array!
	// contains filtered or unexported fields
}

GetPetsResponse defines the response for fetching all pets from a database of pets.

func (*GetPetsResponse) Descriptor deprecated

func (*GetPetsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetPetsResponse.ProtoReflect.Descriptor instead.

func (*GetPetsResponse) GetPet

func (x *GetPetsResponse) GetPet() []*Pet

func (*GetPetsResponse) ProtoMessage

func (*GetPetsResponse) ProtoMessage()

func (*GetPetsResponse) ProtoReflect

func (x *GetPetsResponse) ProtoReflect() protoreflect.Message

func (*GetPetsResponse) Reset

func (x *GetPetsResponse) Reset()

func (*GetPetsResponse) String

func (x *GetPetsResponse) String() string

type Pet

type Pet struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type  string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Breed string `protobuf:"bytes,3,opt,name=breed,proto3" json:"breed,omitempty"`
	Risk  int32  `protobuf:"varint,4,opt,name=risk,proto3" json:"risk,omitempty"`
	// contains filtered or unexported fields
}

Pet defines a pet resource.

func (*Pet) Descriptor deprecated

func (*Pet) Descriptor() ([]byte, []int)

Deprecated: Use Pet.ProtoReflect.Descriptor instead.

func (*Pet) GetBreed

func (x *Pet) GetBreed() string

func (*Pet) GetId

func (x *Pet) GetId() string

func (*Pet) GetRisk

func (x *Pet) GetRisk() int32

func (*Pet) GetType

func (x *Pet) GetType() string

func (*Pet) ProtoMessage

func (*Pet) ProtoMessage()

func (*Pet) ProtoReflect

func (x *Pet) ProtoReflect() protoreflect.Message

func (*Pet) Reset

func (x *Pet) Reset()

func (*Pet) String

func (x *Pet) String() string

type PetsAPIClient

type PetsAPIClient interface {
	GetPet(ctx context.Context, in *GetPetRequest, opts ...grpc.CallOption) (*GetPetResponse, error)
	GetPets(ctx context.Context, in *GetPetsRequest, opts ...grpc.CallOption) (*GetPetsResponse, error)
	AddPet(ctx context.Context, in *AddPetRequest, opts ...grpc.CallOption) (*AddPetResponse, error)
}

PetsAPIClient is the client API for PetsAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewPetsAPIClient

func NewPetsAPIClient(cc grpc.ClientConnInterface) PetsAPIClient

type PetsAPIServer

type PetsAPIServer interface {
	GetPet(context.Context, *GetPetRequest) (*GetPetResponse, error)
	GetPets(context.Context, *GetPetsRequest) (*GetPetsResponse, error)
	AddPet(context.Context, *AddPetRequest) (*AddPetResponse, error)
	// contains filtered or unexported methods
}

PetsAPIServer is the server API for PetsAPI service. All implementations must embed UnimplementedPetsAPIServer for forward compatibility

type UnimplementedPetsAPIServer

type UnimplementedPetsAPIServer struct {
}

UnimplementedPetsAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedPetsAPIServer) AddPet

func (UnimplementedPetsAPIServer) GetPet

func (UnimplementedPetsAPIServer) GetPets

type UnsafePetsAPIServer

type UnsafePetsAPIServer interface {
	// contains filtered or unexported methods
}

UnsafePetsAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PetsAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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