Documentation ¶
Index ¶
- Variables
- func RegisterBeerServiceServer(s grpc.ServiceRegistrar, srv BeerServiceServer)
- type Beer
- func (*Beer) Descriptor() ([]byte, []int)deprecated
- func (x *Beer) GetAlcohol() float32
- func (x *Beer) GetAsin() string
- func (x *Beer) GetBrand() string
- func (x *Beer) GetCountry() string
- func (x *Beer) GetName() string
- func (x *Beer) GetType() Beer_BeerType
- func (*Beer) ProtoMessage()
- func (x *Beer) ProtoReflect() protoreflect.Message
- func (x *Beer) Reset()
- func (x *Beer) String() string
- type BeerServiceClient
- type BeerServiceServer
- type Beer_BeerType
- func (Beer_BeerType) Descriptor() protoreflect.EnumDescriptor
- func (x Beer_BeerType) Enum() *Beer_BeerType
- func (Beer_BeerType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Beer_BeerType) Number() protoreflect.EnumNumber
- func (x Beer_BeerType) String() string
- func (Beer_BeerType) Type() protoreflect.EnumType
- type CreateBeerRequest
- type DeleteBeerRequest
- type GetBeerRequest
- type GetBeerResponse
- type GetBeersResponse
- type UnimplementedBeerServiceServer
- func (UnimplementedBeerServiceServer) AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error)
- func (UnimplementedBeerServiceServer) CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error)
- func (UnimplementedBeerServiceServer) DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error)
- func (UnimplementedBeerServiceServer) GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error)
- func (UnimplementedBeerServiceServer) UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error)
- type UnsafeBeerServiceServer
- type UpdateBeerRequest
- func (*UpdateBeerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateBeerRequest) GetAsin() string
- func (x *UpdateBeerRequest) GetBeer() *Beer
- func (*UpdateBeerRequest) ProtoMessage()
- func (x *UpdateBeerRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateBeerRequest) Reset()
- func (x *UpdateBeerRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Beer_BeerType_name = map[int32]string{ 0: "IndianPaleAle", 1: "SessionIpa", 2: "Lager", } Beer_BeerType_value = map[string]int32{ "IndianPaleAle": 0, "SessionIpa": 1, "Lager": 2, } )
Enum value maps for Beer_BeerType.
var BeerService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "beer.BeerService", HandlerType: (*BeerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AllBeers", Handler: _BeerService_AllBeers_Handler, }, { MethodName: "GetBeer", Handler: _BeerService_GetBeer_Handler, }, { MethodName: "CreateBeer", Handler: _BeerService_CreateBeer_Handler, }, { MethodName: "UpdateBeer", Handler: _BeerService_UpdateBeer_Handler, }, { MethodName: "DeleteBeer", Handler: _BeerService_DeleteBeer_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "beer.proto", }
BeerService_ServiceDesc is the grpc.ServiceDesc for BeerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_beer_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBeerServiceServer ¶
func RegisterBeerServiceServer(s grpc.ServiceRegistrar, srv BeerServiceServer)
Types ¶
type Beer ¶
type Beer struct { Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Brand string `protobuf:"bytes,3,opt,name=brand,proto3" json:"brand,omitempty"` Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"` Alcohol float32 `protobuf:"fixed32,5,opt,name=alcohol,proto3" json:"alcohol,omitempty"` Type Beer_BeerType `protobuf:"varint,6,opt,name=type,proto3,enum=beer.Beer_BeerType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Beer) Descriptor
deprecated
func (*Beer) GetAlcohol ¶
func (*Beer) GetCountry ¶
func (*Beer) GetType ¶
func (x *Beer) GetType() Beer_BeerType
func (*Beer) ProtoMessage ¶
func (*Beer) ProtoMessage()
func (*Beer) ProtoReflect ¶
func (x *Beer) ProtoReflect() protoreflect.Message
type BeerServiceClient ¶
type BeerServiceClient interface { // Get the list of all beers AllBeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetBeersResponse, error) // Get a single beer by Asin GetBeer(ctx context.Context, in *GetBeerRequest, opts ...grpc.CallOption) (*GetBeerResponse, error) // Create a new beer CreateBeer(ctx context.Context, in *CreateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Update an existing beer UpdateBeer(ctx context.Context, in *UpdateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Delete an existing beeer DeleteBeer(ctx context.Context, in *DeleteBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
BeerServiceClient is the client API for BeerService 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 NewBeerServiceClient ¶
func NewBeerServiceClient(cc grpc.ClientConnInterface) BeerServiceClient
type BeerServiceServer ¶
type BeerServiceServer interface { // Get the list of all beers AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error) // Get a single beer by Asin GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error) // Create a new beer CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error) // Update an existing beer UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error) // Delete an existing beeer DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
BeerServiceServer is the server API for BeerService service. All implementations must embed UnimplementedBeerServiceServer for forward compatibility
type Beer_BeerType ¶
type Beer_BeerType int32
const ( Beer_IndianPaleAle Beer_BeerType = 0 Beer_SessionIpa Beer_BeerType = 1 Beer_Lager Beer_BeerType = 2 )
func (Beer_BeerType) Descriptor ¶
func (Beer_BeerType) Descriptor() protoreflect.EnumDescriptor
func (Beer_BeerType) Enum ¶
func (x Beer_BeerType) Enum() *Beer_BeerType
func (Beer_BeerType) EnumDescriptor
deprecated
func (Beer_BeerType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Beer_BeerType.Descriptor instead.
func (Beer_BeerType) Number ¶
func (x Beer_BeerType) Number() protoreflect.EnumNumber
func (Beer_BeerType) String ¶
func (x Beer_BeerType) String() string
func (Beer_BeerType) Type ¶
func (Beer_BeerType) Type() protoreflect.EnumType
type CreateBeerRequest ¶
type CreateBeerRequest struct { Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` // contains filtered or unexported fields }
func (*CreateBeerRequest) Descriptor
deprecated
func (*CreateBeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateBeerRequest.ProtoReflect.Descriptor instead.
func (*CreateBeerRequest) GetBeer ¶
func (x *CreateBeerRequest) GetBeer() *Beer
func (*CreateBeerRequest) ProtoMessage ¶
func (*CreateBeerRequest) ProtoMessage()
func (*CreateBeerRequest) ProtoReflect ¶
func (x *CreateBeerRequest) ProtoReflect() protoreflect.Message
func (*CreateBeerRequest) Reset ¶
func (x *CreateBeerRequest) Reset()
func (*CreateBeerRequest) String ¶
func (x *CreateBeerRequest) String() string
type DeleteBeerRequest ¶
type DeleteBeerRequest struct { Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` // contains filtered or unexported fields }
func (*DeleteBeerRequest) Descriptor
deprecated
func (*DeleteBeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBeerRequest.ProtoReflect.Descriptor instead.
func (*DeleteBeerRequest) GetAsin ¶
func (x *DeleteBeerRequest) GetAsin() string
func (*DeleteBeerRequest) ProtoMessage ¶
func (*DeleteBeerRequest) ProtoMessage()
func (*DeleteBeerRequest) ProtoReflect ¶
func (x *DeleteBeerRequest) ProtoReflect() protoreflect.Message
func (*DeleteBeerRequest) Reset ¶
func (x *DeleteBeerRequest) Reset()
func (*DeleteBeerRequest) String ¶
func (x *DeleteBeerRequest) String() string
type GetBeerRequest ¶
type GetBeerRequest struct { Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` // contains filtered or unexported fields }
func (*GetBeerRequest) Descriptor
deprecated
func (*GetBeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBeerRequest.ProtoReflect.Descriptor instead.
func (*GetBeerRequest) GetAsin ¶
func (x *GetBeerRequest) GetAsin() string
func (*GetBeerRequest) ProtoMessage ¶
func (*GetBeerRequest) ProtoMessage()
func (*GetBeerRequest) ProtoReflect ¶
func (x *GetBeerRequest) ProtoReflect() protoreflect.Message
func (*GetBeerRequest) Reset ¶
func (x *GetBeerRequest) Reset()
func (*GetBeerRequest) String ¶
func (x *GetBeerRequest) String() string
type GetBeerResponse ¶
type GetBeerResponse struct { Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` // contains filtered or unexported fields }
func (*GetBeerResponse) Descriptor
deprecated
func (*GetBeerResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBeerResponse.ProtoReflect.Descriptor instead.
func (*GetBeerResponse) GetBeer ¶
func (x *GetBeerResponse) GetBeer() *Beer
func (*GetBeerResponse) ProtoMessage ¶
func (*GetBeerResponse) ProtoMessage()
func (*GetBeerResponse) ProtoReflect ¶
func (x *GetBeerResponse) ProtoReflect() protoreflect.Message
func (*GetBeerResponse) Reset ¶
func (x *GetBeerResponse) Reset()
func (*GetBeerResponse) String ¶
func (x *GetBeerResponse) String() string
type GetBeersResponse ¶
type GetBeersResponse struct { Beers []*Beer `protobuf:"bytes,1,rep,name=beers,proto3" json:"beers,omitempty"` // contains filtered or unexported fields }
func (*GetBeersResponse) Descriptor
deprecated
func (*GetBeersResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBeersResponse.ProtoReflect.Descriptor instead.
func (*GetBeersResponse) GetBeers ¶
func (x *GetBeersResponse) GetBeers() []*Beer
func (*GetBeersResponse) ProtoMessage ¶
func (*GetBeersResponse) ProtoMessage()
func (*GetBeersResponse) ProtoReflect ¶
func (x *GetBeersResponse) ProtoReflect() protoreflect.Message
func (*GetBeersResponse) Reset ¶
func (x *GetBeersResponse) Reset()
func (*GetBeersResponse) String ¶
func (x *GetBeersResponse) String() string
type UnimplementedBeerServiceServer ¶
type UnimplementedBeerServiceServer struct { }
UnimplementedBeerServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedBeerServiceServer) AllBeers ¶
func (UnimplementedBeerServiceServer) AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error)
func (UnimplementedBeerServiceServer) CreateBeer ¶
func (UnimplementedBeerServiceServer) CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error)
func (UnimplementedBeerServiceServer) DeleteBeer ¶
func (UnimplementedBeerServiceServer) DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error)
func (UnimplementedBeerServiceServer) GetBeer ¶
func (UnimplementedBeerServiceServer) GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error)
func (UnimplementedBeerServiceServer) UpdateBeer ¶
func (UnimplementedBeerServiceServer) UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error)
type UnsafeBeerServiceServer ¶
type UnsafeBeerServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBeerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BeerServiceServer will result in compilation errors.
type UpdateBeerRequest ¶
type UpdateBeerRequest struct { Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` Beer *Beer `protobuf:"bytes,2,opt,name=beer,proto3" json:"beer,omitempty"` // contains filtered or unexported fields }
func (*UpdateBeerRequest) Descriptor
deprecated
func (*UpdateBeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateBeerRequest.ProtoReflect.Descriptor instead.
func (*UpdateBeerRequest) GetAsin ¶
func (x *UpdateBeerRequest) GetAsin() string
func (*UpdateBeerRequest) GetBeer ¶
func (x *UpdateBeerRequest) GetBeer() *Beer
func (*UpdateBeerRequest) ProtoMessage ¶
func (*UpdateBeerRequest) ProtoMessage()
func (*UpdateBeerRequest) ProtoReflect ¶
func (x *UpdateBeerRequest) ProtoReflect() protoreflect.Message
func (*UpdateBeerRequest) Reset ¶
func (x *UpdateBeerRequest) Reset()
func (*UpdateBeerRequest) String ¶
func (x *UpdateBeerRequest) String() string