protos

package
v0.0.0-...-b15666a Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package protos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_movies_service_v1_messages_proto protoreflect.FileDescriptor
View Source
var File_movies_service_v1_proto protoreflect.FileDescriptor
View Source
var MoviesServiceV1_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "movies_service.moviesServiceV1",
	HandlerType: (*MoviesServiceV1Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMovie",
			Handler:    _MoviesServiceV1_GetMovie_Handler,
		},
		{
			MethodName: "GetMoviesPreview",
			Handler:    _MoviesServiceV1_GetMoviesPreview_Handler,
		},
		{
			MethodName: "GetMoviesPreviewByIDs",
			Handler:    _MoviesServiceV1_GetMoviesPreviewByIDs_Handler,
		},
		{
			MethodName: "GetAgeRatings",
			Handler:    _MoviesServiceV1_GetAgeRatings_Handler,
		},
		{
			MethodName: "GetGenres",
			Handler:    _MoviesServiceV1_GetGenres_Handler,
		},
		{
			MethodName: "GetCountries",
			Handler:    _MoviesServiceV1_GetCountries_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "movies_service_v1.proto",
}

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

Functions

func RegisterMoviesServiceV1Handler

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

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

func RegisterMoviesServiceV1HandlerClient

func RegisterMoviesServiceV1HandlerClient(ctx context.Context, mux *runtime.ServeMux, client MoviesServiceV1Client) error

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

func RegisterMoviesServiceV1HandlerFromEndpoint

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

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

func RegisterMoviesServiceV1HandlerServer

func RegisterMoviesServiceV1HandlerServer(ctx context.Context, mux *runtime.ServeMux, server MoviesServiceV1Server) error

RegisterMoviesServiceV1HandlerServer registers the http handlers for service MoviesServiceV1 to "mux". UnaryRPC :call MoviesServiceV1Server 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 RegisterMoviesServiceV1HandlerFromEndpoint instead.

func RegisterMoviesServiceV1Server

func RegisterMoviesServiceV1Server(s grpc.ServiceRegistrar, srv MoviesServiceV1Server)

Types

type AgeRatings

type AgeRatings struct {
	Ratings []string `protobuf:"bytes,1,rep,name=ratings,proto3" json:"ratings,omitempty"`
	// contains filtered or unexported fields
}

func (*AgeRatings) Descriptor deprecated

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

Deprecated: Use AgeRatings.ProtoReflect.Descriptor instead.

func (*AgeRatings) GetRatings

func (x *AgeRatings) GetRatings() []string

func (*AgeRatings) ProtoMessage

func (*AgeRatings) ProtoMessage()

func (*AgeRatings) ProtoReflect

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

func (*AgeRatings) Reset

func (x *AgeRatings) Reset()

func (*AgeRatings) String

func (x *AgeRatings) String() string

type Countries

type Countries struct {
	Countries []*Country `protobuf:"bytes,1,rep,name=countries,proto3" json:"countries,omitempty"`
	// contains filtered or unexported fields
}

func (*Countries) Descriptor deprecated

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

Deprecated: Use Countries.ProtoReflect.Descriptor instead.

func (*Countries) GetCountries

func (x *Countries) GetCountries() []*Country

func (*Countries) ProtoMessage

func (*Countries) ProtoMessage()

func (*Countries) ProtoReflect

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

func (*Countries) Reset

func (x *Countries) Reset()

func (*Countries) String

func (x *Countries) String() string

type Country

type Country struct {
	Id   int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Country) Descriptor deprecated

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

Deprecated: Use Country.ProtoReflect.Descriptor instead.

func (*Country) GetId

func (x *Country) GetId() int32

func (*Country) GetName

func (x *Country) GetName() string

func (*Country) ProtoMessage

func (*Country) ProtoMessage()

func (*Country) ProtoReflect

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

func (*Country) Reset

func (x *Country) Reset()

func (*Country) String

func (x *Country) String() string

type Genre

type Genre struct {
	Id   int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Genre) Descriptor deprecated

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

Deprecated: Use Genre.ProtoReflect.Descriptor instead.

func (*Genre) GetId

func (x *Genre) GetId() int32

func (*Genre) GetName

func (x *Genre) GetName() string

func (*Genre) ProtoMessage

func (*Genre) ProtoMessage()

func (*Genre) ProtoReflect

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

func (*Genre) Reset

func (x *Genre) Reset()

func (*Genre) String

func (x *Genre) String() string

type Genres

type Genres struct {
	Genres []*Genre `protobuf:"bytes,1,rep,name=genres,proto3" json:"genres,omitempty"`
	// contains filtered or unexported fields
}

func (*Genres) Descriptor deprecated

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

Deprecated: Use Genres.ProtoReflect.Descriptor instead.

func (*Genres) GetGenres

func (x *Genres) GetGenres() []*Genre

func (*Genres) ProtoMessage

func (*Genres) ProtoMessage()

func (*Genres) ProtoReflect

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

func (*Genres) Reset

func (x *Genres) Reset()

func (*Genres) String

func (x *Genres) String() string

type GetMovieRequest

type GetMovieRequest struct {
	MovieID int32 `protobuf:"varint,1,opt,name=movieID,json=movie_id,proto3" json:"movieID,omitempty"`
	// Fields to return, valid array values is Movie fields names, leave it empty if you want get all fields
	Mask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMovieRequest) Descriptor deprecated

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

Deprecated: Use GetMovieRequest.ProtoReflect.Descriptor instead.

func (*GetMovieRequest) GetMask

func (x *GetMovieRequest) GetMask() *fieldmaskpb.FieldMask

func (*GetMovieRequest) GetMovieID

func (x *GetMovieRequest) GetMovieID() int32

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 GetMoviesPreviewByIDsRequest

type GetMoviesPreviewByIDsRequest struct {

	// for multiple values use ',' separator
	MoviesIDs string `protobuf:"bytes,1,opt,name=moviesIDs,json=movies_ids,proto3" json:"moviesIDs,omitempty"`
	// Fields to return, valid array values is MoviePreview fields names, leave it empty if you want get all fields
	Mask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMoviesPreviewByIDsRequest) Descriptor deprecated

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

Deprecated: Use GetMoviesPreviewByIDsRequest.ProtoReflect.Descriptor instead.

func (*GetMoviesPreviewByIDsRequest) GetMask

func (*GetMoviesPreviewByIDsRequest) GetMoviesIDs

func (x *GetMoviesPreviewByIDsRequest) GetMoviesIDs() string

func (*GetMoviesPreviewByIDsRequest) ProtoMessage

func (*GetMoviesPreviewByIDsRequest) ProtoMessage()

func (*GetMoviesPreviewByIDsRequest) ProtoReflect

func (*GetMoviesPreviewByIDsRequest) Reset

func (x *GetMoviesPreviewByIDsRequest) Reset()

func (*GetMoviesPreviewByIDsRequest) String

type GetMoviesPreviewRequest

type GetMoviesPreviewRequest struct {
	MoviesIDs    *string `protobuf:"bytes,1,opt,name=moviesIDs,json=movies_ids,proto3,oneof" json:"moviesIDs,omitempty"`
	GenresIDs    *string `protobuf:"bytes,2,opt,name=genresIDs,json=genres_ids,proto3,oneof" json:"genresIDs,omitempty"`
	CountriesIDs *string `protobuf:"bytes,3,opt,name=countriesIDs,json=country_ids,proto3,oneof" json:"countriesIDs,omitempty"`
	Title        *string `protobuf:"bytes,4,opt,name=title,proto3,oneof" json:"title,omitempty"`
	AgeRatings   *string `protobuf:"bytes,5,opt,name=ageRatings,json=age_ratings,proto3,oneof" json:"ageRatings,omitempty"`
	// if limit = 0, will be used default limit = 10, if bigger than 100, will be
	// used max limit = 100
	Limit  uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset uint32 `protobuf:"varint,7,opt,name=offset,proto3" json:"offset,omitempty"`
	// Fields to return, valid array values is MoviePreview fields names, leave it empty if you want get all fields
	Mask *fieldmaskpb.FieldMask `protobuf:"bytes,8,opt,name=mask,proto3" json:"mask,omitempty"`
	// contains filtered or unexported fields
}

for multiple values use ',' separator

func (*GetMoviesPreviewRequest) Descriptor deprecated

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

Deprecated: Use GetMoviesPreviewRequest.ProtoReflect.Descriptor instead.

func (*GetMoviesPreviewRequest) GetAgeRatings

func (x *GetMoviesPreviewRequest) GetAgeRatings() string

func (*GetMoviesPreviewRequest) GetCountriesIDs

func (x *GetMoviesPreviewRequest) GetCountriesIDs() string

func (*GetMoviesPreviewRequest) GetGenresIDs

func (x *GetMoviesPreviewRequest) GetGenresIDs() string

func (*GetMoviesPreviewRequest) GetLimit

func (x *GetMoviesPreviewRequest) GetLimit() uint32

func (*GetMoviesPreviewRequest) GetMask

func (*GetMoviesPreviewRequest) GetMoviesIDs

func (x *GetMoviesPreviewRequest) GetMoviesIDs() string

func (*GetMoviesPreviewRequest) GetOffset

func (x *GetMoviesPreviewRequest) GetOffset() uint32

func (*GetMoviesPreviewRequest) GetTitle

func (x *GetMoviesPreviewRequest) GetTitle() string

func (*GetMoviesPreviewRequest) ProtoMessage

func (*GetMoviesPreviewRequest) ProtoMessage()

func (*GetMoviesPreviewRequest) ProtoReflect

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

func (*GetMoviesPreviewRequest) Reset

func (x *GetMoviesPreviewRequest) Reset()

func (*GetMoviesPreviewRequest) String

func (x *GetMoviesPreviewRequest) String() string

type Movie

type Movie struct {
	Description string   `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	TitleRu     string   `protobuf:"bytes,2,opt,name=title_ru,json=titleRu,proto3" json:"title_ru,omitempty"`
	TitleEn     string   `protobuf:"bytes,3,opt,name=title_en,json=titleEn,proto3" json:"title_en,omitempty"`
	Genres      []string `protobuf:"bytes,4,rep,name=genres,proto3" json:"genres,omitempty"`
	// movie duration in minutes
	Duration      int32    `protobuf:"varint,5,opt,name=duration,proto3" json:"duration,omitempty"`
	Countries     []string `protobuf:"bytes,6,rep,name=countries,proto3" json:"countries,omitempty"`
	PosterUrl     string   `protobuf:"bytes,7,opt,name=poster_url,json=posterUrl,proto3" json:"poster_url,omitempty"`
	BackgroundUrl string   `protobuf:"bytes,8,opt,name=background_url,json=backgroundUrl,proto3" json:"background_url,omitempty"`
	ReleaseYear   int32    `protobuf:"varint,9,opt,name=release_year,json=releaseYear,proto3" json:"release_year,omitempty"`
	AgeRating     string   `protobuf:"bytes,10,opt,name=age_rating,json=ageRating,proto3" json:"age_rating,omitempty"`
	// contains filtered or unexported fields
}

func (*Movie) Descriptor deprecated

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

Deprecated: Use Movie.ProtoReflect.Descriptor instead.

func (*Movie) GetAgeRating

func (x *Movie) GetAgeRating() string

func (*Movie) GetBackgroundUrl

func (x *Movie) GetBackgroundUrl() string

func (*Movie) GetCountries

func (x *Movie) GetCountries() []string

func (*Movie) GetDescription

func (x *Movie) GetDescription() string

func (*Movie) GetDuration

func (x *Movie) GetDuration() int32

func (*Movie) GetGenres

func (x *Movie) GetGenres() []string

func (*Movie) GetPosterUrl

func (x *Movie) GetPosterUrl() string

func (*Movie) GetReleaseYear

func (x *Movie) GetReleaseYear() int32

func (*Movie) GetTitleEn

func (x *Movie) GetTitleEn() string

func (*Movie) GetTitleRu

func (x *Movie) GetTitleRu() string

func (*Movie) ProtoMessage

func (*Movie) ProtoMessage()

func (*Movie) ProtoReflect

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

func (*Movie) Reset

func (x *Movie) Reset()

func (*Movie) String

func (x *Movie) String() string

type MoviePreview

type MoviePreview struct {
	ShortDescription string `protobuf:"bytes,1,opt,name=short_description,json=shortDescription,proto3" json:"short_description,omitempty"`
	TitleRu          string `protobuf:"bytes,2,opt,name=title_ru,json=titleRu,proto3" json:"title_ru,omitempty"`
	TitleEn          string `protobuf:"bytes,3,opt,name=title_en,json=titleEn,proto3" json:"title_en,omitempty"`
	// movie duration in minutes
	Duration         int32    `protobuf:"varint,4,opt,name=duration,proto3" json:"duration,omitempty"`
	PreviewPosterUrl string   `protobuf:"bytes,5,opt,name=preview_poster_url,json=previewPosterUrl,proto3" json:"preview_poster_url,omitempty"`
	Countries        []string `protobuf:"bytes,6,rep,name=countries,proto3" json:"countries,omitempty"`
	Genres           []string `protobuf:"bytes,7,rep,name=genres,proto3" json:"genres,omitempty"`
	ReleaseYear      int32    `protobuf:"varint,8,opt,name=release_year,json=releaseYear,proto3" json:"release_year,omitempty"`
	AgeRating        string   `protobuf:"bytes,9,opt,name=age_rating,json=ageRating,proto3" json:"age_rating,omitempty"`
	// contains filtered or unexported fields
}

func (*MoviePreview) Descriptor deprecated

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

Deprecated: Use MoviePreview.ProtoReflect.Descriptor instead.

func (*MoviePreview) GetAgeRating

func (x *MoviePreview) GetAgeRating() string

func (*MoviePreview) GetCountries

func (x *MoviePreview) GetCountries() []string

func (*MoviePreview) GetDuration

func (x *MoviePreview) GetDuration() int32

func (*MoviePreview) GetGenres

func (x *MoviePreview) GetGenres() []string

func (*MoviePreview) GetPreviewPosterUrl

func (x *MoviePreview) GetPreviewPosterUrl() string

func (*MoviePreview) GetReleaseYear

func (x *MoviePreview) GetReleaseYear() int32

func (*MoviePreview) GetShortDescription

func (x *MoviePreview) GetShortDescription() string

func (*MoviePreview) GetTitleEn

func (x *MoviePreview) GetTitleEn() string

func (*MoviePreview) GetTitleRu

func (x *MoviePreview) GetTitleRu() string

func (*MoviePreview) ProtoMessage

func (*MoviePreview) ProtoMessage()

func (*MoviePreview) ProtoReflect

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

func (*MoviePreview) Reset

func (x *MoviePreview) Reset()

func (*MoviePreview) String

func (x *MoviePreview) String() string

type MoviesPreview

type MoviesPreview struct {
	Movies map[int32]*MoviePreview `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*MoviesPreview) Descriptor deprecated

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

Deprecated: Use MoviesPreview.ProtoReflect.Descriptor instead.

func (*MoviesPreview) GetMovies

func (x *MoviesPreview) GetMovies() map[int32]*MoviePreview

func (*MoviesPreview) ProtoMessage

func (*MoviesPreview) ProtoMessage()

func (*MoviesPreview) ProtoReflect

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

func (*MoviesPreview) Reset

func (x *MoviesPreview) Reset()

func (*MoviesPreview) String

func (x *MoviesPreview) String() string

type MoviesServiceV1Client

type MoviesServiceV1Client interface {
	// Returns movie with the specified id.
	GetMovie(ctx context.Context, in *GetMovieRequest, opts ...grpc.CallOption) (*Movie, error)
	// Returns movies previews with the specified filter.
	GetMoviesPreview(ctx context.Context, in *GetMoviesPreviewRequest, opts ...grpc.CallOption) (*MoviesPreview, error)
	// Returns movies previews with the specified ids.
	GetMoviesPreviewByIDs(ctx context.Context, in *GetMoviesPreviewByIDsRequest, opts ...grpc.CallOption) (*MoviesPreview, error)
	// Returns all age ratings.
	GetAgeRatings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AgeRatings, error)
	// Returns all genres.
	GetGenres(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Genres, error)
	// Returns all countries.
	GetCountries(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Countries, error)
}

MoviesServiceV1Client is the client API for MoviesServiceV1 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 MoviesServiceV1Server

type MoviesServiceV1Server interface {
	// Returns movie with the specified id.
	GetMovie(context.Context, *GetMovieRequest) (*Movie, error)
	// Returns movies previews with the specified filter.
	GetMoviesPreview(context.Context, *GetMoviesPreviewRequest) (*MoviesPreview, error)
	// Returns movies previews with the specified ids.
	GetMoviesPreviewByIDs(context.Context, *GetMoviesPreviewByIDsRequest) (*MoviesPreview, error)
	// Returns all age ratings.
	GetAgeRatings(context.Context, *emptypb.Empty) (*AgeRatings, error)
	// Returns all genres.
	GetGenres(context.Context, *emptypb.Empty) (*Genres, error)
	// Returns all countries.
	GetCountries(context.Context, *emptypb.Empty) (*Countries, error)
	// contains filtered or unexported methods
}

MoviesServiceV1Server is the server API for MoviesServiceV1 service. All implementations must embed UnimplementedMoviesServiceV1Server for forward compatibility

type UnimplementedMoviesServiceV1Server

type UnimplementedMoviesServiceV1Server struct {
}

UnimplementedMoviesServiceV1Server must be embedded to have forward compatible implementations.

func (UnimplementedMoviesServiceV1Server) GetAgeRatings

func (UnimplementedMoviesServiceV1Server) GetCountries

func (UnimplementedMoviesServiceV1Server) GetGenres

func (UnimplementedMoviesServiceV1Server) GetMovie

func (UnimplementedMoviesServiceV1Server) GetMoviesPreview

func (UnimplementedMoviesServiceV1Server) GetMoviesPreviewByIDs

type UnsafeMoviesServiceV1Server

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

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

type UserErrorMessage

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

func (*UserErrorMessage) Descriptor deprecated

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

Deprecated: Use UserErrorMessage.ProtoReflect.Descriptor instead.

func (*UserErrorMessage) GetMessage

func (x *UserErrorMessage) GetMessage() string

func (*UserErrorMessage) ProtoMessage

func (*UserErrorMessage) ProtoMessage()

func (*UserErrorMessage) ProtoReflect

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

func (*UserErrorMessage) Reset

func (x *UserErrorMessage) Reset()

func (*UserErrorMessage) String

func (x *UserErrorMessage) String() string

Jump to

Keyboard shortcuts

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