movieapi

package
v0.0.0-...-6f2c00c Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_movieapi_movieapi_proto protoreflect.FileDescriptor
View Source
var MovieInfo_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "movieapi.MovieInfo",
	HandlerType: (*MovieInfoServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMovieInfo",
			Handler:    _MovieInfo_GetMovieInfo_Handler,
		},
		{
			MethodName: "setMovieInfo",
			Handler:    _MovieInfo_SetMovieInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "movieapi/movieapi.proto",
}

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

Functions

func RegisterMovieInfoServer

func RegisterMovieInfoServer(s grpc.ServiceRegistrar, srv MovieInfoServer)

Types

type MovieData

type MovieData struct {
	Title    string   `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Year     int32    `protobuf:"varint,2,opt,name=year,proto3" json:"year,omitempty"`
	Director string   `protobuf:"bytes,3,opt,name=director,proto3" json:"director,omitempty"`
	Cast     []string `protobuf:"bytes,4,rep,name=cast,proto3" json:"cast,omitempty"`
	// contains filtered or unexported fields
}

The request message of setMovieInfo contains movie info

func (*MovieData) Descriptor deprecated

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

Deprecated: Use MovieData.ProtoReflect.Descriptor instead.

func (*MovieData) GetCast

func (x *MovieData) GetCast() []string

func (*MovieData) GetDirector

func (x *MovieData) GetDirector() string

func (*MovieData) GetTitle

func (x *MovieData) GetTitle() string

func (*MovieData) GetYear

func (x *MovieData) GetYear() int32

func (*MovieData) ProtoMessage

func (*MovieData) ProtoMessage()

func (*MovieData) ProtoReflect

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

func (*MovieData) Reset

func (x *MovieData) Reset()

func (*MovieData) String

func (x *MovieData) String() string

type MovieInfoClient

type MovieInfoClient interface {
	// Sends a requeest for movie info
	GetMovieInfo(ctx context.Context, in *MovieRequest, opts ...grpc.CallOption) (*MovieReply, error)
	//send a request for adding a movie info to database
	SetMovieInfo(ctx context.Context, in *MovieData, opts ...grpc.CallOption) (*Status, error)
}

MovieInfoClient is the client API for MovieInfo 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 NewMovieInfoClient

func NewMovieInfoClient(cc grpc.ClientConnInterface) MovieInfoClient

type MovieInfoServer

type MovieInfoServer interface {
	// Sends a requeest for movie info
	GetMovieInfo(context.Context, *MovieRequest) (*MovieReply, error)
	//send a request for adding a movie info to database
	SetMovieInfo(context.Context, *MovieData) (*Status, error)
	// contains filtered or unexported methods
}

MovieInfoServer is the server API for MovieInfo service. All implementations must embed UnimplementedMovieInfoServer for forward compatibility

type MovieReply

type MovieReply struct {
	Year     int32    `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"`
	Director string   `protobuf:"bytes,2,opt,name=director,proto3" json:"director,omitempty"`
	Cast     []string `protobuf:"bytes,3,rep,name=cast,proto3" json:"cast,omitempty"`
	// contains filtered or unexported fields
}

The response message containining movie info

func (*MovieReply) Descriptor deprecated

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

Deprecated: Use MovieReply.ProtoReflect.Descriptor instead.

func (*MovieReply) GetCast

func (x *MovieReply) GetCast() []string

func (*MovieReply) GetDirector

func (x *MovieReply) GetDirector() string

func (*MovieReply) GetYear

func (x *MovieReply) GetYear() int32

func (*MovieReply) ProtoMessage

func (*MovieReply) ProtoMessage()

func (*MovieReply) ProtoReflect

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

func (*MovieReply) Reset

func (x *MovieReply) Reset()

func (*MovieReply) String

func (x *MovieReply) String() string

type MovieRequest

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

The request message containing movie name

func (*MovieRequest) Descriptor deprecated

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

Deprecated: Use MovieRequest.ProtoReflect.Descriptor instead.

func (*MovieRequest) GetTitle

func (x *MovieRequest) GetTitle() string

func (*MovieRequest) ProtoMessage

func (*MovieRequest) ProtoMessage()

func (*MovieRequest) ProtoReflect

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

func (*MovieRequest) Reset

func (x *MovieRequest) Reset()

func (*MovieRequest) String

func (x *MovieRequest) String() string

type Status

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

The response message of setMovieInfo contains an error message

func (*Status) Descriptor deprecated

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

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetStatus

func (x *Status) GetStatus() string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

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

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type UnimplementedMovieInfoServer

type UnimplementedMovieInfoServer struct {
}

UnimplementedMovieInfoServer must be embedded to have forward compatible implementations.

func (UnimplementedMovieInfoServer) GetMovieInfo

func (UnimplementedMovieInfoServer) SetMovieInfo

type UnsafeMovieInfoServer

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

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

Jump to

Keyboard shortcuts

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