film_service

package module
v0.0.0-...-62b4e5e Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package film_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_alex1472_film_service_api_v1_film_service_api_proto protoreflect.FileDescriptor
View Source
var FilmService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "alex1472.ozon_film_service.film_service.v1.FilmService",
	HandlerType: (*FilmServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListFilmsV1",
			Handler:    _FilmService_ListFilmsV1_Handler,
		},
		{
			MethodName: "DescribeFilmV1",
			Handler:    _FilmService_DescribeFilmV1_Handler,
		},
		{
			MethodName: "CreateFilmV1",
			Handler:    _FilmService_CreateFilmV1_Handler,
		},
		{
			MethodName: "RemoveFilmV1",
			Handler:    _FilmService_RemoveFilmV1_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "alex1472/film_service_api/v1/film_service_api.proto",
}

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

Functions

func RegisterFilmServiceHandler

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

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

func RegisterFilmServiceHandlerClient

func RegisterFilmServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FilmServiceClient) error

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

func RegisterFilmServiceHandlerFromEndpoint

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

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

func RegisterFilmServiceHandlerServer

func RegisterFilmServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FilmServiceServer) error

RegisterFilmServiceHandlerServer registers the http handlers for service FilmService to "mux". UnaryRPC :call FilmServiceServer 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 RegisterFilmServiceHandlerFromEndpoint instead.

func RegisterFilmServiceServer

func RegisterFilmServiceServer(s grpc.ServiceRegistrar, srv FilmServiceServer)

Types

type CreateFilmV1Request

type CreateFilmV1Request struct {
	Name             string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Rating           float64 `protobuf:"fixed64,2,opt,name=rating,proto3" json:"rating,omitempty"`
	ShortDescription string  `protobuf:"bytes,3,opt,name=shortDescription,proto3" json:"shortDescription,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateFilmV1Request) Descriptor deprecated

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

Deprecated: Use CreateFilmV1Request.ProtoReflect.Descriptor instead.

func (*CreateFilmV1Request) GetName

func (x *CreateFilmV1Request) GetName() string

func (*CreateFilmV1Request) GetRating

func (x *CreateFilmV1Request) GetRating() float64

func (*CreateFilmV1Request) GetShortDescription

func (x *CreateFilmV1Request) GetShortDescription() string

func (*CreateFilmV1Request) ProtoMessage

func (*CreateFilmV1Request) ProtoMessage()

func (*CreateFilmV1Request) ProtoReflect

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

func (*CreateFilmV1Request) Reset

func (x *CreateFilmV1Request) Reset()

func (*CreateFilmV1Request) String

func (x *CreateFilmV1Request) String() string

func (*CreateFilmV1Request) Validate

func (m *CreateFilmV1Request) Validate() error

Validate checks the field values on CreateFilmV1Request with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateFilmV1RequestValidationError

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

CreateFilmV1RequestValidationError is the validation error returned by CreateFilmV1Request.Validate if the designated constraints aren't met.

func (CreateFilmV1RequestValidationError) Cause

Cause function returns cause value.

func (CreateFilmV1RequestValidationError) Error

Error satisfies the builtin error interface

func (CreateFilmV1RequestValidationError) ErrorName

ErrorName returns error name.

func (CreateFilmV1RequestValidationError) Field

Field function returns field value.

func (CreateFilmV1RequestValidationError) Key

Key function returns key value.

func (CreateFilmV1RequestValidationError) Reason

Reason function returns reason value.

type CreateFilmV1Response

type CreateFilmV1Response struct {
	FilmId uint64 `protobuf:"varint,1,opt,name=film_id,json=filmId,proto3" json:"film_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateFilmV1Response) Descriptor deprecated

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

Deprecated: Use CreateFilmV1Response.ProtoReflect.Descriptor instead.

func (*CreateFilmV1Response) GetFilmId

func (x *CreateFilmV1Response) GetFilmId() uint64

func (*CreateFilmV1Response) ProtoMessage

func (*CreateFilmV1Response) ProtoMessage()

func (*CreateFilmV1Response) ProtoReflect

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

func (*CreateFilmV1Response) Reset

func (x *CreateFilmV1Response) Reset()

func (*CreateFilmV1Response) String

func (x *CreateFilmV1Response) String() string

func (*CreateFilmV1Response) Validate

func (m *CreateFilmV1Response) Validate() error

Validate checks the field values on CreateFilmV1Response with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateFilmV1ResponseValidationError

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

CreateFilmV1ResponseValidationError is the validation error returned by CreateFilmV1Response.Validate if the designated constraints aren't met.

func (CreateFilmV1ResponseValidationError) Cause

Cause function returns cause value.

func (CreateFilmV1ResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateFilmV1ResponseValidationError) ErrorName

ErrorName returns error name.

func (CreateFilmV1ResponseValidationError) Field

Field function returns field value.

func (CreateFilmV1ResponseValidationError) Key

Key function returns key value.

func (CreateFilmV1ResponseValidationError) Reason

Reason function returns reason value.

type DescribeFilmV1Request

type DescribeFilmV1Request struct {
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeFilmV1Request) Descriptor deprecated

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

Deprecated: Use DescribeFilmV1Request.ProtoReflect.Descriptor instead.

func (*DescribeFilmV1Request) GetId

func (x *DescribeFilmV1Request) GetId() uint64

func (*DescribeFilmV1Request) ProtoMessage

func (*DescribeFilmV1Request) ProtoMessage()

func (*DescribeFilmV1Request) ProtoReflect

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

func (*DescribeFilmV1Request) Reset

func (x *DescribeFilmV1Request) Reset()

func (*DescribeFilmV1Request) String

func (x *DescribeFilmV1Request) String() string

func (*DescribeFilmV1Request) Validate

func (m *DescribeFilmV1Request) Validate() error

Validate checks the field values on DescribeFilmV1Request with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type DescribeFilmV1RequestValidationError

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

DescribeFilmV1RequestValidationError is the validation error returned by DescribeFilmV1Request.Validate if the designated constraints aren't met.

func (DescribeFilmV1RequestValidationError) Cause

Cause function returns cause value.

func (DescribeFilmV1RequestValidationError) Error

Error satisfies the builtin error interface

func (DescribeFilmV1RequestValidationError) ErrorName

ErrorName returns error name.

func (DescribeFilmV1RequestValidationError) Field

Field function returns field value.

func (DescribeFilmV1RequestValidationError) Key

Key function returns key value.

func (DescribeFilmV1RequestValidationError) Reason

Reason function returns reason value.

type DescribeFilmV1Response

type DescribeFilmV1Response struct {
	Value *Film `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeFilmV1Response) Descriptor deprecated

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

Deprecated: Use DescribeFilmV1Response.ProtoReflect.Descriptor instead.

func (*DescribeFilmV1Response) GetValue

func (x *DescribeFilmV1Response) GetValue() *Film

func (*DescribeFilmV1Response) ProtoMessage

func (*DescribeFilmV1Response) ProtoMessage()

func (*DescribeFilmV1Response) ProtoReflect

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

func (*DescribeFilmV1Response) Reset

func (x *DescribeFilmV1Response) Reset()

func (*DescribeFilmV1Response) String

func (x *DescribeFilmV1Response) String() string

func (*DescribeFilmV1Response) Validate

func (m *DescribeFilmV1Response) Validate() error

Validate checks the field values on DescribeFilmV1Response with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type DescribeFilmV1ResponseValidationError

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

DescribeFilmV1ResponseValidationError is the validation error returned by DescribeFilmV1Response.Validate if the designated constraints aren't met.

func (DescribeFilmV1ResponseValidationError) Cause

Cause function returns cause value.

func (DescribeFilmV1ResponseValidationError) Error

Error satisfies the builtin error interface

func (DescribeFilmV1ResponseValidationError) ErrorName

ErrorName returns error name.

func (DescribeFilmV1ResponseValidationError) Field

Field function returns field value.

func (DescribeFilmV1ResponseValidationError) Key

Key function returns key value.

func (DescribeFilmV1ResponseValidationError) Reason

Reason function returns reason value.

type Film

type Film struct {
	Id               uint64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name             string  `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Rating           float64 `protobuf:"fixed64,3,opt,name=rating,proto3" json:"rating,omitempty"`
	ShortDescription string  `protobuf:"bytes,4,opt,name=shortDescription,proto3" json:"shortDescription,omitempty"`
	// contains filtered or unexported fields
}

func (*Film) Descriptor deprecated

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

Deprecated: Use Film.ProtoReflect.Descriptor instead.

func (*Film) GetId

func (x *Film) GetId() uint64

func (*Film) GetName

func (x *Film) GetName() string

func (*Film) GetRating

func (x *Film) GetRating() float64

func (*Film) GetShortDescription

func (x *Film) GetShortDescription() string

func (*Film) ProtoMessage

func (*Film) ProtoMessage()

func (*Film) ProtoReflect

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

func (*Film) Reset

func (x *Film) Reset()

func (*Film) String

func (x *Film) String() string

func (*Film) Validate

func (m *Film) Validate() error

Validate checks the field values on Film with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type FilmServiceClient

type FilmServiceClient interface {
	ListFilmsV1(ctx context.Context, in *ListFilmsV1Request, opts ...grpc.CallOption) (*ListFilmsV1Response, error)
	DescribeFilmV1(ctx context.Context, in *DescribeFilmV1Request, opts ...grpc.CallOption) (*DescribeFilmV1Response, error)
	CreateFilmV1(ctx context.Context, in *CreateFilmV1Request, opts ...grpc.CallOption) (*CreateFilmV1Response, error)
	RemoveFilmV1(ctx context.Context, in *RemoveFilmV1Request, opts ...grpc.CallOption) (*RemoveFilmV1Response, error)
}

FilmServiceClient is the client API for FilmService 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 FilmServiceServer

type FilmServiceServer interface {
	ListFilmsV1(context.Context, *ListFilmsV1Request) (*ListFilmsV1Response, error)
	DescribeFilmV1(context.Context, *DescribeFilmV1Request) (*DescribeFilmV1Response, error)
	CreateFilmV1(context.Context, *CreateFilmV1Request) (*CreateFilmV1Response, error)
	RemoveFilmV1(context.Context, *RemoveFilmV1Request) (*RemoveFilmV1Response, error)
	// contains filtered or unexported methods
}

FilmServiceServer is the server API for FilmService service. All implementations must embed UnimplementedFilmServiceServer for forward compatibility

type FilmValidationError

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

FilmValidationError is the validation error returned by Film.Validate if the designated constraints aren't met.

func (FilmValidationError) Cause

func (e FilmValidationError) Cause() error

Cause function returns cause value.

func (FilmValidationError) Error

func (e FilmValidationError) Error() string

Error satisfies the builtin error interface

func (FilmValidationError) ErrorName

func (e FilmValidationError) ErrorName() string

ErrorName returns error name.

func (FilmValidationError) Field

func (e FilmValidationError) Field() string

Field function returns field value.

func (FilmValidationError) Key

func (e FilmValidationError) Key() bool

Key function returns key value.

func (FilmValidationError) Reason

func (e FilmValidationError) Reason() string

Reason function returns reason value.

type ListFilmsV1Request

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

func (*ListFilmsV1Request) Descriptor deprecated

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

Deprecated: Use ListFilmsV1Request.ProtoReflect.Descriptor instead.

func (*ListFilmsV1Request) ProtoMessage

func (*ListFilmsV1Request) ProtoMessage()

func (*ListFilmsV1Request) ProtoReflect

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

func (*ListFilmsV1Request) Reset

func (x *ListFilmsV1Request) Reset()

func (*ListFilmsV1Request) String

func (x *ListFilmsV1Request) String() string

func (*ListFilmsV1Request) Validate

func (m *ListFilmsV1Request) Validate() error

Validate checks the field values on ListFilmsV1Request with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ListFilmsV1RequestValidationError

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

ListFilmsV1RequestValidationError is the validation error returned by ListFilmsV1Request.Validate if the designated constraints aren't met.

func (ListFilmsV1RequestValidationError) Cause

Cause function returns cause value.

func (ListFilmsV1RequestValidationError) Error

Error satisfies the builtin error interface

func (ListFilmsV1RequestValidationError) ErrorName

ErrorName returns error name.

func (ListFilmsV1RequestValidationError) Field

Field function returns field value.

func (ListFilmsV1RequestValidationError) Key

Key function returns key value.

func (ListFilmsV1RequestValidationError) Reason

Reason function returns reason value.

type ListFilmsV1Response

type ListFilmsV1Response struct {
	Items []*Film `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFilmsV1Response) Descriptor deprecated

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

Deprecated: Use ListFilmsV1Response.ProtoReflect.Descriptor instead.

func (*ListFilmsV1Response) GetItems

func (x *ListFilmsV1Response) GetItems() []*Film

func (*ListFilmsV1Response) ProtoMessage

func (*ListFilmsV1Response) ProtoMessage()

func (*ListFilmsV1Response) ProtoReflect

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

func (*ListFilmsV1Response) Reset

func (x *ListFilmsV1Response) Reset()

func (*ListFilmsV1Response) String

func (x *ListFilmsV1Response) String() string

func (*ListFilmsV1Response) Validate

func (m *ListFilmsV1Response) Validate() error

Validate checks the field values on ListFilmsV1Response with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ListFilmsV1ResponseValidationError

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

ListFilmsV1ResponseValidationError is the validation error returned by ListFilmsV1Response.Validate if the designated constraints aren't met.

func (ListFilmsV1ResponseValidationError) Cause

Cause function returns cause value.

func (ListFilmsV1ResponseValidationError) Error

Error satisfies the builtin error interface

func (ListFilmsV1ResponseValidationError) ErrorName

ErrorName returns error name.

func (ListFilmsV1ResponseValidationError) Field

Field function returns field value.

func (ListFilmsV1ResponseValidationError) Key

Key function returns key value.

func (ListFilmsV1ResponseValidationError) Reason

Reason function returns reason value.

type RemoveFilmV1Request

type RemoveFilmV1Request struct {
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveFilmV1Request) Descriptor deprecated

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

Deprecated: Use RemoveFilmV1Request.ProtoReflect.Descriptor instead.

func (*RemoveFilmV1Request) GetId

func (x *RemoveFilmV1Request) GetId() uint64

func (*RemoveFilmV1Request) ProtoMessage

func (*RemoveFilmV1Request) ProtoMessage()

func (*RemoveFilmV1Request) ProtoReflect

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

func (*RemoveFilmV1Request) Reset

func (x *RemoveFilmV1Request) Reset()

func (*RemoveFilmV1Request) String

func (x *RemoveFilmV1Request) String() string

func (*RemoveFilmV1Request) Validate

func (m *RemoveFilmV1Request) Validate() error

Validate checks the field values on RemoveFilmV1Request with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RemoveFilmV1RequestValidationError

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

RemoveFilmV1RequestValidationError is the validation error returned by RemoveFilmV1Request.Validate if the designated constraints aren't met.

func (RemoveFilmV1RequestValidationError) Cause

Cause function returns cause value.

func (RemoveFilmV1RequestValidationError) Error

Error satisfies the builtin error interface

func (RemoveFilmV1RequestValidationError) ErrorName

ErrorName returns error name.

func (RemoveFilmV1RequestValidationError) Field

Field function returns field value.

func (RemoveFilmV1RequestValidationError) Key

Key function returns key value.

func (RemoveFilmV1RequestValidationError) Reason

Reason function returns reason value.

type RemoveFilmV1Response

type RemoveFilmV1Response struct {
	Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveFilmV1Response) Descriptor deprecated

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

Deprecated: Use RemoveFilmV1Response.ProtoReflect.Descriptor instead.

func (*RemoveFilmV1Response) GetFound

func (x *RemoveFilmV1Response) GetFound() bool

func (*RemoveFilmV1Response) ProtoMessage

func (*RemoveFilmV1Response) ProtoMessage()

func (*RemoveFilmV1Response) ProtoReflect

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

func (*RemoveFilmV1Response) Reset

func (x *RemoveFilmV1Response) Reset()

func (*RemoveFilmV1Response) String

func (x *RemoveFilmV1Response) String() string

func (*RemoveFilmV1Response) Validate

func (m *RemoveFilmV1Response) Validate() error

Validate checks the field values on RemoveFilmV1Response with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RemoveFilmV1ResponseValidationError

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

RemoveFilmV1ResponseValidationError is the validation error returned by RemoveFilmV1Response.Validate if the designated constraints aren't met.

func (RemoveFilmV1ResponseValidationError) Cause

Cause function returns cause value.

func (RemoveFilmV1ResponseValidationError) Error

Error satisfies the builtin error interface

func (RemoveFilmV1ResponseValidationError) ErrorName

ErrorName returns error name.

func (RemoveFilmV1ResponseValidationError) Field

Field function returns field value.

func (RemoveFilmV1ResponseValidationError) Key

Key function returns key value.

func (RemoveFilmV1ResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedFilmServiceServer

type UnimplementedFilmServiceServer struct {
}

UnimplementedFilmServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedFilmServiceServer) CreateFilmV1

func (UnimplementedFilmServiceServer) DescribeFilmV1

func (UnimplementedFilmServiceServer) ListFilmsV1

func (UnimplementedFilmServiceServer) RemoveFilmV1

type UnsafeFilmServiceServer

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

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

Directories

Path Synopsis
google.golang.org
protobuf/types/known/timestamppb
Package timestamppb contains generated types for google/protobuf/timestamp.proto.
Package timestamppb contains generated types for google/protobuf/timestamp.proto.

Jump to

Keyboard shortcuts

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