Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMovieServiceHandler(s server.Server, hdlr MovieServiceHandler, opts ...server.HandlerOption) error
- func RegisterMovieServiceServer(s grpc.ServiceRegistrar, srv MovieServiceServer)
- type GetMovieRequest
- type GetMovieResponse
- type Movie
- func (*Movie) Descriptor() ([]byte, []int)deprecated
- func (x *Movie) GetCover() string
- func (x *Movie) GetCriticRating() float32
- func (x *Movie) GetTitle() string
- func (x *Movie) GetUserRating() float32
- func (*Movie) ProtoMessage()
- func (x *Movie) ProtoReflect() protoreflect.Message
- func (x *Movie) Reset()
- func (x *Movie) String() string
- type MovieService
- type MovieServiceClient
- type MovieServiceHandler
- type MovieServiceServer
- type UnimplementedMovieServiceServer
- type UnsafeMovieServiceServer
Constants ¶
const (
MovieService_GetMovie_FullMethodName = "/movie.MovieService/GetMovie"
)
Variables ¶
var File_micro_movie_movie_proto protoreflect.FileDescriptor
var MovieService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "movie.MovieService", HandlerType: (*MovieServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMovie", Handler: _MovieService_GetMovie_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "micro/movie/movie.proto", }
MovieService_ServiceDesc is the grpc.ServiceDesc for MovieService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMovieServiceHandler ¶
func RegisterMovieServiceHandler(s server.Server, hdlr MovieServiceHandler, opts ...server.HandlerOption) error
func RegisterMovieServiceServer ¶
func RegisterMovieServiceServer(s grpc.ServiceRegistrar, srv MovieServiceServer)
Types ¶
type GetMovieRequest ¶
type GetMovieRequest struct {
MovieId uint64 `protobuf:"varint,1,opt,name=movie_id,json=movieId,proto3" json:"movie_id,omitempty"`
// contains filtered or unexported fields
}
func (*GetMovieRequest) Descriptor
deprecated
func (*GetMovieRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMovieRequest.ProtoReflect.Descriptor instead.
func (*GetMovieRequest) GetMovieId ¶
func (x *GetMovieRequest) GetMovieId() uint64
func (*GetMovieRequest) ProtoMessage ¶
func (*GetMovieRequest) ProtoMessage()
func (*GetMovieRequest) ProtoReflect ¶
func (x *GetMovieRequest) ProtoReflect() protoreflect.Message
func (*GetMovieRequest) Reset ¶
func (x *GetMovieRequest) Reset()
func (*GetMovieRequest) String ¶
func (x *GetMovieRequest) String() string
type GetMovieResponse ¶
type GetMovieResponse struct {
Movie *Movie `protobuf:"bytes,1,opt,name=movie,proto3" json:"movie,omitempty"`
// contains filtered or unexported fields
}
func (*GetMovieResponse) Descriptor
deprecated
func (*GetMovieResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMovieResponse.ProtoReflect.Descriptor instead.
func (*GetMovieResponse) GetMovie ¶
func (x *GetMovieResponse) GetMovie() *Movie
func (*GetMovieResponse) ProtoMessage ¶
func (*GetMovieResponse) ProtoMessage()
func (*GetMovieResponse) ProtoReflect ¶
func (x *GetMovieResponse) ProtoReflect() protoreflect.Message
func (*GetMovieResponse) Reset ¶
func (x *GetMovieResponse) Reset()
func (*GetMovieResponse) String ¶
func (x *GetMovieResponse) String() string
type Movie ¶
type Movie struct {
Cover string `protobuf:"bytes,1,opt,name=cover,proto3" json:"cover,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
CriticRating float32 `protobuf:"fixed32,3,opt,name=critic_rating,json=criticRating,proto3" json:"critic_rating,omitempty"`
UserRating float32 `protobuf:"fixed32,4,opt,name=user_rating,json=userRating,proto3" json:"user_rating,omitempty"`
// contains filtered or unexported fields
}
func (*Movie) Descriptor
deprecated
func (*Movie) GetCriticRating ¶
func (*Movie) GetUserRating ¶
func (*Movie) ProtoMessage ¶
func (*Movie) ProtoMessage()
func (*Movie) ProtoReflect ¶
func (x *Movie) ProtoReflect() protoreflect.Message
type MovieService ¶
type MovieService interface {
GetMovie(ctx context.Context, in *GetMovieRequest, opts ...client.CallOption) (*GetMovieResponse, error)
}
func NewMovieService ¶
func NewMovieService(name string, c client.Client) MovieService
type MovieServiceClient ¶
type MovieServiceClient interface {
GetMovie(ctx context.Context, in *GetMovieRequest, opts ...grpc.CallOption) (*GetMovieResponse, error)
}
MovieServiceClient is the client API for MovieService 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.
protoc --proto_path=api --micro_out=.. --go-grpc_out=.. --go_out=.. api/micro/movie/movie.proto
func NewMovieServiceClient ¶
func NewMovieServiceClient(cc grpc.ClientConnInterface) MovieServiceClient
type MovieServiceHandler ¶
type MovieServiceHandler interface {
GetMovie(context.Context, *GetMovieRequest, *GetMovieResponse) error
}
type MovieServiceServer ¶
type MovieServiceServer interface {
GetMovie(context.Context, *GetMovieRequest) (*GetMovieResponse, error)
// contains filtered or unexported methods
}
MovieServiceServer is the server API for MovieService service. All implementations must embed UnimplementedMovieServiceServer for forward compatibility.
protoc --proto_path=api --micro_out=.. --go-grpc_out=.. --go_out=.. api/micro/movie/movie.proto
type UnimplementedMovieServiceServer ¶
type UnimplementedMovieServiceServer struct{}
UnimplementedMovieServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMovieServiceServer) GetMovie ¶
func (UnimplementedMovieServiceServer) GetMovie(context.Context, *GetMovieRequest) (*GetMovieResponse, error)
type UnsafeMovieServiceServer ¶
type UnsafeMovieServiceServer interface {
// contains filtered or unexported methods
}
UnsafeMovieServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MovieServiceServer will result in compilation errors.