hashipetv1

package
v0.0.0-...-f6ef990 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package hashipetv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Species_name = map[int32]string{
		0: "SPECIES_UNSPECIFIED",
		1: "SPECIES_PIG",
		2: "SPECIES_DOG",
		3: "SPECIES_CAT",
	}
	Species_value = map[string]int32{
		"SPECIES_UNSPECIFIED": 0,
		"SPECIES_PIG":         1,
		"SPECIES_DOG":         2,
		"SPECIES_CAT":         3,
	}
)

Enum value maps for Species.

View Source
var File_hashipet_v1_hashipet_proto protoreflect.FileDescriptor
View Source
var HashiPetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hashipet.v1.HashiPetService",
	HandlerType: (*HashiPetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreatePet",
			Handler:    _HashiPetService_CreatePet_Handler,
		},
		{
			MethodName: "GetPet",
			Handler:    _HashiPetService_GetPet_Handler,
		},
		{
			MethodName: "ListPets",
			Handler:    _HashiPetService_ListPets_Handler,
		},
		{
			MethodName: "DeletePet",
			Handler:    _HashiPetService_DeletePet_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "hashipet/v1/hashipet.proto",
}

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

Functions

func RegisterHashiPetServiceHandler

func RegisterHashiPetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterHashiPetServiceHandler registers the http handlers for service HashiPetService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterHashiPetServiceHandlerClient

func RegisterHashiPetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HashiPetServiceClient) error

RegisterHashiPetServiceHandlerClient registers the http handlers for service HashiPetService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HashiPetServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HashiPetServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HashiPetServiceClient" to call the correct interceptors.

func RegisterHashiPetServiceHandlerFromEndpoint

func RegisterHashiPetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterHashiPetServiceHandlerFromEndpoint is same as RegisterHashiPetServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterHashiPetServiceHandlerServer

func RegisterHashiPetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HashiPetServiceServer) error

RegisterHashiPetServiceHandlerServer registers the http handlers for service HashiPetService to "mux". UnaryRPC :call HashiPetServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHashiPetServiceHandlerFromEndpoint instead.

func RegisterHashiPetServiceServer

func RegisterHashiPetServiceServer(s grpc.ServiceRegistrar, srv HashiPetServiceServer)

Types

type CreatePetRequest

type CreatePetRequest struct {
	Pet *Pet `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"`
	// contains filtered or unexported fields
}

func (*CreatePetRequest) Descriptor deprecated

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

Deprecated: Use CreatePetRequest.ProtoReflect.Descriptor instead.

func (*CreatePetRequest) GetPet

func (x *CreatePetRequest) GetPet() *Pet

func (*CreatePetRequest) ProtoMessage

func (*CreatePetRequest) ProtoMessage()

func (*CreatePetRequest) ProtoReflect

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

func (*CreatePetRequest) Reset

func (x *CreatePetRequest) Reset()

func (*CreatePetRequest) String

func (x *CreatePetRequest) String() string

type CreatePetResponse

type CreatePetResponse struct {
	Pet *Pet `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"`
	// contains filtered or unexported fields
}

func (*CreatePetResponse) Descriptor deprecated

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

Deprecated: Use CreatePetResponse.ProtoReflect.Descriptor instead.

func (*CreatePetResponse) GetPet

func (x *CreatePetResponse) GetPet() *Pet

func (*CreatePetResponse) ProtoMessage

func (*CreatePetResponse) ProtoMessage()

func (*CreatePetResponse) ProtoReflect

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

func (*CreatePetResponse) Reset

func (x *CreatePetResponse) Reset()

func (*CreatePetResponse) String

func (x *CreatePetResponse) String() string

type DeletePetRequest

type DeletePetRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*DeletePetRequest) Descriptor deprecated

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

Deprecated: Use DeletePetRequest.ProtoReflect.Descriptor instead.

func (*DeletePetRequest) GetName

func (x *DeletePetRequest) GetName() string

func (*DeletePetRequest) ProtoMessage

func (*DeletePetRequest) ProtoMessage()

func (*DeletePetRequest) ProtoReflect

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

func (*DeletePetRequest) Reset

func (x *DeletePetRequest) Reset()

func (*DeletePetRequest) String

func (x *DeletePetRequest) String() string

type GetPetRequest

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

func (*GetPetRequest) Descriptor deprecated

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

Deprecated: Use GetPetRequest.ProtoReflect.Descriptor instead.

func (*GetPetRequest) GetName

func (x *GetPetRequest) GetName() 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"`
	// contains filtered or unexported fields
}

func (*GetPetResponse) Descriptor deprecated

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

Deprecated: Use GetPetResponse.ProtoReflect.Descriptor instead.

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 HashiPetServiceClient

type HashiPetServiceClient interface {
	CreatePet(ctx context.Context, in *CreatePetRequest, opts ...grpc.CallOption) (*CreatePetResponse, error)
	GetPet(ctx context.Context, in *GetPetRequest, opts ...grpc.CallOption) (*GetPetResponse, error)
	ListPets(ctx context.Context, in *ListPetsRequest, opts ...grpc.CallOption) (*ListPetsResponse, error)
	DeletePet(ctx context.Context, in *DeletePetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

HashiPetServiceClient is the client API for HashiPetService 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.

type HashiPetServiceServer

HashiPetServiceServer is the server API for HashiPetService service. All implementations should embed UnimplementedHashiPetServiceServer for forward compatibility

type ListPetsRequest

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

func (*ListPetsRequest) Descriptor deprecated

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

Deprecated: Use ListPetsRequest.ProtoReflect.Descriptor instead.

func (*ListPetsRequest) ProtoMessage

func (*ListPetsRequest) ProtoMessage()

func (*ListPetsRequest) ProtoReflect

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

func (*ListPetsRequest) Reset

func (x *ListPetsRequest) Reset()

func (*ListPetsRequest) String

func (x *ListPetsRequest) String() string

type ListPetsResponse

type ListPetsResponse struct {
	Pets []*Pet `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	// contains filtered or unexported fields
}

func (*ListPetsResponse) Descriptor deprecated

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

Deprecated: Use ListPetsResponse.ProtoReflect.Descriptor instead.

func (*ListPetsResponse) GetPets

func (x *ListPetsResponse) GetPets() []*Pet

func (*ListPetsResponse) ProtoMessage

func (*ListPetsResponse) ProtoMessage()

func (*ListPetsResponse) ProtoReflect

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

func (*ListPetsResponse) Reset

func (x *ListPetsResponse) Reset()

func (*ListPetsResponse) String

func (x *ListPetsResponse) String() string

type Pet

type Pet struct {
	Name       string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Owner      string  `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	Species    Species `protobuf:"varint,3,opt,name=species,proto3,enum=hashipet.v1.Species" json:"species,omitempty"`
	PictureUrl string  `protobuf:"bytes,4,opt,name=picture_url,json=pictureUrl,proto3" json:"picture_url,omitempty"`
	// contains filtered or unexported fields
}

func (*Pet) Descriptor deprecated

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

Deprecated: Use Pet.ProtoReflect.Descriptor instead.

func (*Pet) GetName

func (x *Pet) GetName() string

func (*Pet) GetOwner

func (x *Pet) GetOwner() string

func (*Pet) GetPictureUrl

func (x *Pet) GetPictureUrl() string

func (*Pet) GetSpecies

func (x *Pet) GetSpecies() Species

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 Species

type Species int32
const (
	Species_SPECIES_UNSPECIFIED Species = 0
	Species_SPECIES_PIG         Species = 1
	Species_SPECIES_DOG         Species = 2
	Species_SPECIES_CAT         Species = 3
)

func (Species) Descriptor

func (Species) Descriptor() protoreflect.EnumDescriptor

func (Species) Enum

func (x Species) Enum() *Species

func (Species) EnumDescriptor deprecated

func (Species) EnumDescriptor() ([]byte, []int)

Deprecated: Use Species.Descriptor instead.

func (Species) Number

func (x Species) Number() protoreflect.EnumNumber

func (Species) String

func (x Species) String() string

func (Species) Type

func (Species) Type() protoreflect.EnumType

type UnimplementedHashiPetServiceServer

type UnimplementedHashiPetServiceServer struct {
}

UnimplementedHashiPetServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedHashiPetServiceServer) CreatePet

func (UnimplementedHashiPetServiceServer) DeletePet

func (UnimplementedHashiPetServiceServer) GetPet

func (UnimplementedHashiPetServiceServer) ListPets

type UnsafeHashiPetServiceServer

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

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

Jump to

Keyboard shortcuts

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