Documentation ¶
Overview ¶
Package Mod is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterModServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterModServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModServiceClient) error
- func RegisterModServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterModServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModServiceServer) error
- func RegisterModServiceServer(s grpc.ServiceRegistrar, srv ModServiceServer)
- type GetModByIDRequest
- type GetModByIDResponse
- type Mod
- func (*Mod) Descriptor() ([]byte, []int)deprecated
- func (x *Mod) GetCreate_At() *timestamppb.Timestamp
- func (x *Mod) GetDescription() string
- func (x *Mod) GetID() string
- func (x *Mod) GetName() string
- func (x *Mod) GetReleaseYear() int32
- func (*Mod) ProtoMessage()
- func (x *Mod) ProtoReflect() protoreflect.Message
- func (x *Mod) Reset()
- func (x *Mod) String() string
- type ModServiceClient
- type ModServiceServer
- type Pagination
- func (*Pagination) Descriptor() ([]byte, []int)deprecated
- func (x *Pagination) GetFirst() bool
- func (x *Pagination) GetLast() bool
- func (x *Pagination) GetMaxPage() int64
- func (x *Pagination) GetPage() int64
- func (x *Pagination) GetSize() int64
- func (x *Pagination) GetTotal() int64
- func (x *Pagination) GetTotalPages() int64
- func (x *Pagination) GetVisible() int64
- func (*Pagination) ProtoMessage()
- func (x *Pagination) ProtoReflect() protoreflect.Message
- func (x *Pagination) Reset()
- func (x *Pagination) String() string
- type SearchModRequest
- func (*SearchModRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchModRequest) GetPage() int64
- func (x *SearchModRequest) GetSearchText() string
- func (x *SearchModRequest) GetSize() int64
- func (*SearchModRequest) ProtoMessage()
- func (x *SearchModRequest) ProtoReflect() protoreflect.Message
- func (x *SearchModRequest) Reset()
- func (x *SearchModRequest) String() string
- type SearchModResponse
- func (*SearchModResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SearchModResponse) GetMods() []*Mod
- func (x *SearchModResponse) GetPagination() *Pagination
- func (*SearchModResponse) ProtoMessage()
- func (x *SearchModResponse) ProtoReflect() protoreflect.Message
- func (x *SearchModResponse) Reset()
- func (x *SearchModResponse) String() string
- type UnimplementedModServiceServer
- type UnsafeModServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_mod_mod_proto protoreflect.FileDescriptor
var ModService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "mod_service.ModService", HandlerType: (*ModServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SearchMod", Handler: _ModService_SearchMod_Handler, }, { MethodName: "GetModByID", Handler: _ModService_GetModByID_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "mod/mod.proto", }
ModService_ServiceDesc is the grpc.ServiceDesc for ModService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterModServiceHandler ¶
func RegisterModServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterModServiceHandler registers the http handlers for service ModService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterModServiceHandlerClient ¶
func RegisterModServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModServiceClient) error
RegisterModServiceHandlerClient registers the http handlers for service ModService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ModServiceClient" to call the correct interceptors.
func RegisterModServiceHandlerFromEndpoint ¶
func RegisterModServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterModServiceHandlerFromEndpoint is same as RegisterModServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterModServiceHandlerServer ¶
func RegisterModServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModServiceServer) error
RegisterModServiceHandlerServer registers the http handlers for service ModService to "mux". UnaryRPC :call ModServiceServer 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 RegisterModServiceHandlerFromEndpoint instead.
func RegisterModServiceServer ¶
func RegisterModServiceServer(s grpc.ServiceRegistrar, srv ModServiceServer)
Types ¶
type GetModByIDRequest ¶
type GetModByIDRequest struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
GetModByID
func (*GetModByIDRequest) Descriptor
deprecated
func (*GetModByIDRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetModByIDRequest.ProtoReflect.Descriptor instead.
func (*GetModByIDRequest) GetID ¶
func (x *GetModByIDRequest) GetID() string
func (*GetModByIDRequest) ProtoMessage ¶
func (*GetModByIDRequest) ProtoMessage()
func (*GetModByIDRequest) ProtoReflect ¶
func (x *GetModByIDRequest) ProtoReflect() protoreflect.Message
func (*GetModByIDRequest) Reset ¶
func (x *GetModByIDRequest) Reset()
func (*GetModByIDRequest) String ¶
func (x *GetModByIDRequest) String() string
type GetModByIDResponse ¶
type GetModByIDResponse struct { Mod *Mod `protobuf:"bytes,1,opt,name=Mod,proto3" json:"Mod,omitempty"` // contains filtered or unexported fields }
func (*GetModByIDResponse) Descriptor
deprecated
func (*GetModByIDResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetModByIDResponse.ProtoReflect.Descriptor instead.
func (*GetModByIDResponse) GetMod ¶
func (x *GetModByIDResponse) GetMod() *Mod
func (*GetModByIDResponse) ProtoMessage ¶
func (*GetModByIDResponse) ProtoMessage()
func (*GetModByIDResponse) ProtoReflect ¶
func (x *GetModByIDResponse) ProtoReflect() protoreflect.Message
func (*GetModByIDResponse) Reset ¶
func (x *GetModByIDResponse) Reset()
func (*GetModByIDResponse) String ¶
func (x *GetModByIDResponse) String() string
type Mod ¶
type Mod struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Description string `protobuf:"bytes,3,opt,name=Description,proto3" json:"Description,omitempty"` // string ModTypeCategoryID = 4; ReleaseYear int32 `protobuf:"varint,5,opt,name=ReleaseYear,proto3" json:"ReleaseYear,omitempty"` Create_At *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=Create_At,json=CreateAt,proto3" json:"Create_At,omitempty"` // contains filtered or unexported fields }
func (*Mod) Descriptor
deprecated
func (*Mod) GetCreate_At ¶
func (x *Mod) GetCreate_At() *timestamppb.Timestamp
func (*Mod) GetDescription ¶
func (*Mod) GetReleaseYear ¶
func (*Mod) ProtoMessage ¶
func (*Mod) ProtoMessage()
func (*Mod) ProtoReflect ¶
func (x *Mod) ProtoReflect() protoreflect.Message
type ModServiceClient ¶
type ModServiceClient interface { SearchMod(ctx context.Context, in *SearchModRequest, opts ...grpc.CallOption) (*SearchModResponse, error) GetModByID(ctx context.Context, in *GetModByIDRequest, opts ...grpc.CallOption) (*GetModByIDResponse, error) }
ModServiceClient is the client API for ModService 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 NewModServiceClient ¶
func NewModServiceClient(cc grpc.ClientConnInterface) ModServiceClient
type ModServiceServer ¶
type ModServiceServer interface { SearchMod(context.Context, *SearchModRequest) (*SearchModResponse, error) GetModByID(context.Context, *GetModByIDRequest) (*GetModByIDResponse, error) // contains filtered or unexported methods }
ModServiceServer is the server API for ModService service. All implementations must embed UnimplementedModServiceServer for forward compatibility
type Pagination ¶
type Pagination struct { Page int64 `protobuf:"varint,1,opt,name=Page,proto3" json:"Page,omitempty"` Size int64 `protobuf:"varint,2,opt,name=Size,proto3" json:"Size,omitempty"` MaxPage int64 `protobuf:"varint,3,opt,name=MaxPage,proto3" json:"MaxPage,omitempty"` TotalPages int64 `protobuf:"varint,4,opt,name=TotalPages,proto3" json:"TotalPages,omitempty"` Total int64 `protobuf:"varint,5,opt,name=Total,proto3" json:"Total,omitempty"` Last bool `protobuf:"varint,6,opt,name=Last,proto3" json:"Last,omitempty"` First bool `protobuf:"varint,7,opt,name=First,proto3" json:"First,omitempty"` Visible int64 `protobuf:"varint,8,opt,name=Visible,proto3" json:"Visible,omitempty"` // contains filtered or unexported fields }
func (*Pagination) Descriptor
deprecated
func (*Pagination) Descriptor() ([]byte, []int)
Deprecated: Use Pagination.ProtoReflect.Descriptor instead.
func (*Pagination) GetFirst ¶
func (x *Pagination) GetFirst() bool
func (*Pagination) GetLast ¶
func (x *Pagination) GetLast() bool
func (*Pagination) GetMaxPage ¶
func (x *Pagination) GetMaxPage() int64
func (*Pagination) GetPage ¶
func (x *Pagination) GetPage() int64
func (*Pagination) GetSize ¶
func (x *Pagination) GetSize() int64
func (*Pagination) GetTotal ¶
func (x *Pagination) GetTotal() int64
func (*Pagination) GetTotalPages ¶
func (x *Pagination) GetTotalPages() int64
func (*Pagination) GetVisible ¶
func (x *Pagination) GetVisible() int64
func (*Pagination) ProtoMessage ¶
func (*Pagination) ProtoMessage()
func (*Pagination) ProtoReflect ¶
func (x *Pagination) ProtoReflect() protoreflect.Message
func (*Pagination) Reset ¶
func (x *Pagination) Reset()
func (*Pagination) String ¶
func (x *Pagination) String() string
type SearchModRequest ¶
type SearchModRequest struct { SearchText string `protobuf:"bytes,1,opt,name=SearchText,proto3" json:"SearchText,omitempty"` Size int64 `protobuf:"varint,2,opt,name=Size,proto3" json:"Size,omitempty"` Page int64 `protobuf:"varint,3,opt,name=Page,proto3" json:"Page,omitempty"` // contains filtered or unexported fields }
SearchMod
func (*SearchModRequest) Descriptor
deprecated
func (*SearchModRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchModRequest.ProtoReflect.Descriptor instead.
func (*SearchModRequest) GetPage ¶
func (x *SearchModRequest) GetPage() int64
func (*SearchModRequest) GetSearchText ¶
func (x *SearchModRequest) GetSearchText() string
func (*SearchModRequest) GetSize ¶
func (x *SearchModRequest) GetSize() int64
func (*SearchModRequest) ProtoMessage ¶
func (*SearchModRequest) ProtoMessage()
func (*SearchModRequest) ProtoReflect ¶
func (x *SearchModRequest) ProtoReflect() protoreflect.Message
func (*SearchModRequest) Reset ¶
func (x *SearchModRequest) Reset()
func (*SearchModRequest) String ¶
func (x *SearchModRequest) String() string
type SearchModResponse ¶
type SearchModResponse struct { Pagination *Pagination `protobuf:"bytes,1,opt,name=Pagination,proto3" json:"Pagination,omitempty"` Mods []*Mod `protobuf:"bytes,2,rep,name=Mods,proto3" json:"Mods,omitempty"` // contains filtered or unexported fields }
func (*SearchModResponse) Descriptor
deprecated
func (*SearchModResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchModResponse.ProtoReflect.Descriptor instead.
func (*SearchModResponse) GetMods ¶
func (x *SearchModResponse) GetMods() []*Mod
func (*SearchModResponse) GetPagination ¶
func (x *SearchModResponse) GetPagination() *Pagination
func (*SearchModResponse) ProtoMessage ¶
func (*SearchModResponse) ProtoMessage()
func (*SearchModResponse) ProtoReflect ¶
func (x *SearchModResponse) ProtoReflect() protoreflect.Message
func (*SearchModResponse) Reset ¶
func (x *SearchModResponse) Reset()
func (*SearchModResponse) String ¶
func (x *SearchModResponse) String() string
type UnimplementedModServiceServer ¶
type UnimplementedModServiceServer struct { }
UnimplementedModServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedModServiceServer) GetModByID ¶
func (UnimplementedModServiceServer) GetModByID(context.Context, *GetModByIDRequest) (*GetModByIDResponse, error)
func (UnimplementedModServiceServer) SearchMod ¶
func (UnimplementedModServiceServer) SearchMod(context.Context, *SearchModRequest) (*SearchModResponse, error)
type UnsafeModServiceServer ¶
type UnsafeModServiceServer interface {
// contains filtered or unexported methods
}
UnsafeModServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ModServiceServer will result in compilation errors.