Documentation ¶
Overview ¶
Package nyaa is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterNyaaHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNyaaHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NyaaClient) error
- func RegisterNyaaHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNyaaServer(s *grpc.Server, srv NyaaServer)
- type CurrentResultsReply
- func (*CurrentResultsReply) Descriptor() ([]byte, []int)
- func (m *CurrentResultsReply) GetResults() []*Result
- func (*CurrentResultsReply) ProtoMessage()
- func (m *CurrentResultsReply) Reset()
- func (m *CurrentResultsReply) String() string
- func (m *CurrentResultsReply) XXX_DiscardUnknown()
- func (m *CurrentResultsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CurrentResultsReply) XXX_Merge(src proto.Message)
- func (m *CurrentResultsReply) XXX_Size() int
- func (m *CurrentResultsReply) XXX_Unmarshal(b []byte) error
- type CurrentResultsRequest
- func (*CurrentResultsRequest) Descriptor() ([]byte, []int)
- func (*CurrentResultsRequest) ProtoMessage()
- func (m *CurrentResultsRequest) Reset()
- func (m *CurrentResultsRequest) String() string
- func (m *CurrentResultsRequest) XXX_DiscardUnknown()
- func (m *CurrentResultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CurrentResultsRequest) XXX_Merge(src proto.Message)
- func (m *CurrentResultsRequest) XXX_Size() int
- func (m *CurrentResultsRequest) XXX_Unmarshal(b []byte) error
- type NyaaClient
- type NyaaServer
- type PingReply
- func (*PingReply) Descriptor() ([]byte, []int)
- func (m *PingReply) GetMessage() string
- func (*PingReply) ProtoMessage()
- func (m *PingReply) Reset()
- func (m *PingReply) String() string
- func (m *PingReply) XXX_DiscardUnknown()
- func (m *PingReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PingReply) XXX_Merge(src proto.Message)
- func (m *PingReply) XXX_Size() int
- func (m *PingReply) XXX_Unmarshal(b []byte) error
- type PingRequest
- func (*PingRequest) Descriptor() ([]byte, []int)
- func (m *PingRequest) GetMessage() string
- func (*PingRequest) ProtoMessage()
- func (m *PingRequest) Reset()
- func (m *PingRequest) String() string
- func (m *PingRequest) XXX_DiscardUnknown()
- func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PingRequest) XXX_Merge(src proto.Message)
- func (m *PingRequest) XXX_Size() int
- func (m *PingRequest) XXX_Unmarshal(b []byte) error
- type Result
- func (*Result) Descriptor() ([]byte, []int)
- func (m *Result) GetCategory() string
- func (m *Result) GetDate() string
- func (m *Result) GetDownloads() uint32
- func (m *Result) GetLeechers() uint32
- func (m *Result) GetLink() string
- func (m *Result) GetName() string
- func (m *Result) GetSeeders() uint32
- func (m *Result) GetSize() string
- func (*Result) ProtoMessage()
- func (m *Result) Reset()
- func (m *Result) String() string
- func (m *Result) XXX_DiscardUnknown()
- func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Result) XXX_Merge(src proto.Message)
- func (m *Result) XXX_Size() int
- func (m *Result) XXX_Unmarshal(b []byte) error
- type SearchReply
- func (*SearchReply) Descriptor() ([]byte, []int)
- func (m *SearchReply) GetResults() []*Result
- func (*SearchReply) ProtoMessage()
- func (m *SearchReply) Reset()
- func (m *SearchReply) String() string
- func (m *SearchReply) XXX_DiscardUnknown()
- func (m *SearchReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SearchReply) XXX_Merge(src proto.Message)
- func (m *SearchReply) XXX_Size() int
- func (m *SearchReply) XXX_Unmarshal(b []byte) error
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)
- func (m *SearchRequest) GetCategory() string
- func (m *SearchRequest) GetFilter() string
- func (m *SearchRequest) GetOrder() string
- func (m *SearchRequest) GetPage() uint32
- func (m *SearchRequest) GetQuery() string
- func (m *SearchRequest) GetSort() string
- func (*SearchRequest) ProtoMessage()
- func (m *SearchRequest) Reset()
- func (m *SearchRequest) String() string
- func (m *SearchRequest) XXX_DiscardUnknown()
- func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SearchRequest) XXX_Merge(src proto.Message)
- func (m *SearchRequest) XXX_Size() int
- func (m *SearchRequest) XXX_Unmarshal(b []byte) error
- type ShutdownReply
- func (*ShutdownReply) Descriptor() ([]byte, []int)
- func (*ShutdownReply) ProtoMessage()
- func (m *ShutdownReply) Reset()
- func (m *ShutdownReply) String() string
- func (m *ShutdownReply) XXX_DiscardUnknown()
- func (m *ShutdownReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShutdownReply) XXX_Merge(src proto.Message)
- func (m *ShutdownReply) XXX_Size() int
- func (m *ShutdownReply) XXX_Unmarshal(b []byte) error
- type ShutdownRequest
- func (*ShutdownRequest) Descriptor() ([]byte, []int)
- func (*ShutdownRequest) ProtoMessage()
- func (m *ShutdownRequest) Reset()
- func (m *ShutdownRequest) String() string
- func (m *ShutdownRequest) XXX_DiscardUnknown()
- func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShutdownRequest) XXX_Merge(src proto.Message)
- func (m *ShutdownRequest) XXX_Size() int
- func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedNyaaServer
- func (*UnimplementedNyaaServer) CurrentResults(ctx context.Context, req *CurrentResultsRequest) (*CurrentResultsReply, error)
- func (*UnimplementedNyaaServer) Ping(ctx context.Context, req *PingRequest) (*PingReply, error)
- func (*UnimplementedNyaaServer) Search(ctx context.Context, req *SearchRequest) (*SearchReply, error)
- func (*UnimplementedNyaaServer) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterNyaaHandler ¶
RegisterNyaaHandler registers the http handlers for service Nyaa to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNyaaHandlerClient ¶
RegisterNyaaHandlerClient registers the http handlers for service Nyaa to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NyaaClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NyaaClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NyaaClient" to call the correct interceptors.
func RegisterNyaaHandlerFromEndpoint ¶
func RegisterNyaaHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNyaaHandlerFromEndpoint is same as RegisterNyaaHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNyaaServer ¶
func RegisterNyaaServer(s *grpc.Server, srv NyaaServer)
Types ¶
type CurrentResultsReply ¶
type CurrentResultsReply struct { Results []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CurrentResultsReply) Descriptor ¶
func (*CurrentResultsReply) Descriptor() ([]byte, []int)
func (*CurrentResultsReply) GetResults ¶
func (m *CurrentResultsReply) GetResults() []*Result
func (*CurrentResultsReply) ProtoMessage ¶
func (*CurrentResultsReply) ProtoMessage()
func (*CurrentResultsReply) Reset ¶
func (m *CurrentResultsReply) Reset()
func (*CurrentResultsReply) String ¶
func (m *CurrentResultsReply) String() string
func (*CurrentResultsReply) XXX_DiscardUnknown ¶
func (m *CurrentResultsReply) XXX_DiscardUnknown()
func (*CurrentResultsReply) XXX_Marshal ¶
func (m *CurrentResultsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CurrentResultsReply) XXX_Merge ¶
func (m *CurrentResultsReply) XXX_Merge(src proto.Message)
func (*CurrentResultsReply) XXX_Size ¶
func (m *CurrentResultsReply) XXX_Size() int
func (*CurrentResultsReply) XXX_Unmarshal ¶
func (m *CurrentResultsReply) XXX_Unmarshal(b []byte) error
type CurrentResultsRequest ¶
type CurrentResultsRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CurrentResultsRequest) Descriptor ¶
func (*CurrentResultsRequest) Descriptor() ([]byte, []int)
func (*CurrentResultsRequest) ProtoMessage ¶
func (*CurrentResultsRequest) ProtoMessage()
func (*CurrentResultsRequest) Reset ¶
func (m *CurrentResultsRequest) Reset()
func (*CurrentResultsRequest) String ¶
func (m *CurrentResultsRequest) String() string
func (*CurrentResultsRequest) XXX_DiscardUnknown ¶
func (m *CurrentResultsRequest) XXX_DiscardUnknown()
func (*CurrentResultsRequest) XXX_Marshal ¶
func (m *CurrentResultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CurrentResultsRequest) XXX_Merge ¶
func (m *CurrentResultsRequest) XXX_Merge(src proto.Message)
func (*CurrentResultsRequest) XXX_Size ¶
func (m *CurrentResultsRequest) XXX_Size() int
func (*CurrentResultsRequest) XXX_Unmarshal ¶
func (m *CurrentResultsRequest) XXX_Unmarshal(b []byte) error
type NyaaClient ¶
type NyaaClient interface { Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownReply, error) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchReply, error) CurrentResults(ctx context.Context, in *CurrentResultsRequest, opts ...grpc.CallOption) (*CurrentResultsReply, error) }
NyaaClient is the client API for Nyaa service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewNyaaClient ¶
func NewNyaaClient(cc *grpc.ClientConn) NyaaClient
type NyaaServer ¶
type NyaaServer interface { Ping(context.Context, *PingRequest) (*PingReply, error) Shutdown(context.Context, *ShutdownRequest) (*ShutdownReply, error) Search(context.Context, *SearchRequest) (*SearchReply, error) CurrentResults(context.Context, *CurrentResultsRequest) (*CurrentResultsReply, error) }
NyaaServer is the server API for Nyaa service.
type PingReply ¶
type PingReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The response message containing the greetings
func (*PingReply) Descriptor ¶
func (*PingReply) GetMessage ¶
func (*PingReply) ProtoMessage ¶
func (*PingReply) ProtoMessage()
func (*PingReply) XXX_DiscardUnknown ¶
func (m *PingReply) XXX_DiscardUnknown()
func (*PingReply) XXX_Marshal ¶
func (*PingReply) XXX_Unmarshal ¶
type PingRequest ¶
type PingRequest struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The ping message containing the user's name.
func (*PingRequest) Descriptor ¶
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) GetMessage ¶
func (m *PingRequest) GetMessage() string
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) String ¶
func (m *PingRequest) String() string
func (*PingRequest) XXX_DiscardUnknown ¶
func (m *PingRequest) XXX_DiscardUnknown()
func (*PingRequest) XXX_Marshal ¶
func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PingRequest) XXX_Merge ¶
func (m *PingRequest) XXX_Merge(src proto.Message)
func (*PingRequest) XXX_Size ¶
func (m *PingRequest) XXX_Size() int
func (*PingRequest) XXX_Unmarshal ¶
func (m *PingRequest) XXX_Unmarshal(b []byte) error
type Result ¶
type Result struct { Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` Size string `protobuf:"bytes,4,opt,name=size,proto3" json:"size,omitempty"` Date string `protobuf:"bytes,5,opt,name=date,proto3" json:"date,omitempty"` Seeders uint32 `protobuf:"varint,6,opt,name=seeders,proto3" json:"seeders,omitempty"` Leechers uint32 `protobuf:"varint,7,opt,name=leechers,proto3" json:"leechers,omitempty"` Downloads uint32 `protobuf:"varint,8,opt,name=downloads,proto3" json:"downloads,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Result) Descriptor ¶
func (*Result) GetCategory ¶
func (*Result) GetDownloads ¶
func (*Result) GetLeechers ¶
func (*Result) GetSeeders ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) XXX_DiscardUnknown ¶
func (m *Result) XXX_DiscardUnknown()
func (*Result) XXX_Marshal ¶
func (*Result) XXX_Unmarshal ¶
type SearchReply ¶
type SearchReply struct { Results []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SearchReply) Descriptor ¶
func (*SearchReply) Descriptor() ([]byte, []int)
func (*SearchReply) GetResults ¶
func (m *SearchReply) GetResults() []*Result
func (*SearchReply) ProtoMessage ¶
func (*SearchReply) ProtoMessage()
func (*SearchReply) Reset ¶
func (m *SearchReply) Reset()
func (*SearchReply) String ¶
func (m *SearchReply) String() string
func (*SearchReply) XXX_DiscardUnknown ¶
func (m *SearchReply) XXX_DiscardUnknown()
func (*SearchReply) XXX_Marshal ¶
func (m *SearchReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SearchReply) XXX_Merge ¶
func (m *SearchReply) XXX_Merge(src proto.Message)
func (*SearchReply) XXX_Size ¶
func (m *SearchReply) XXX_Size() int
func (*SearchReply) XXX_Unmarshal ¶
func (m *SearchReply) XXX_Unmarshal(b []byte) error
type SearchRequest ¶
type SearchRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` Category string `protobuf:"bytes,3,opt,name=category,proto3" json:"category,omitempty"` Sort string `protobuf:"bytes,4,opt,name=sort,proto3" json:"sort,omitempty"` Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"` Page uint32 `protobuf:"varint,6,opt,name=page,proto3" json:"page,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SearchRequest) Descriptor ¶
func (*SearchRequest) Descriptor() ([]byte, []int)
func (*SearchRequest) GetCategory ¶
func (m *SearchRequest) GetCategory() string
func (*SearchRequest) GetFilter ¶
func (m *SearchRequest) GetFilter() string
func (*SearchRequest) GetOrder ¶
func (m *SearchRequest) GetOrder() string
func (*SearchRequest) GetPage ¶
func (m *SearchRequest) GetPage() uint32
func (*SearchRequest) GetQuery ¶
func (m *SearchRequest) GetQuery() string
func (*SearchRequest) GetSort ¶
func (m *SearchRequest) GetSort() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) Reset ¶
func (m *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (m *SearchRequest) String() string
func (*SearchRequest) XXX_DiscardUnknown ¶
func (m *SearchRequest) XXX_DiscardUnknown()
func (*SearchRequest) XXX_Marshal ¶
func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SearchRequest) XXX_Merge ¶
func (m *SearchRequest) XXX_Merge(src proto.Message)
func (*SearchRequest) XXX_Size ¶
func (m *SearchRequest) XXX_Size() int
func (*SearchRequest) XXX_Unmarshal ¶
func (m *SearchRequest) XXX_Unmarshal(b []byte) error
type ShutdownReply ¶
type ShutdownReply struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ShutdownReply) Descriptor ¶
func (*ShutdownReply) Descriptor() ([]byte, []int)
func (*ShutdownReply) ProtoMessage ¶
func (*ShutdownReply) ProtoMessage()
func (*ShutdownReply) Reset ¶
func (m *ShutdownReply) Reset()
func (*ShutdownReply) String ¶
func (m *ShutdownReply) String() string
func (*ShutdownReply) XXX_DiscardUnknown ¶
func (m *ShutdownReply) XXX_DiscardUnknown()
func (*ShutdownReply) XXX_Marshal ¶
func (m *ShutdownReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShutdownReply) XXX_Merge ¶
func (m *ShutdownReply) XXX_Merge(src proto.Message)
func (*ShutdownReply) XXX_Size ¶
func (m *ShutdownReply) XXX_Size() int
func (*ShutdownReply) XXX_Unmarshal ¶
func (m *ShutdownReply) XXX_Unmarshal(b []byte) error
type ShutdownRequest ¶
type ShutdownRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ShutdownRequest) Descriptor ¶
func (*ShutdownRequest) Descriptor() ([]byte, []int)
func (*ShutdownRequest) ProtoMessage ¶
func (*ShutdownRequest) ProtoMessage()
func (*ShutdownRequest) Reset ¶
func (m *ShutdownRequest) Reset()
func (*ShutdownRequest) String ¶
func (m *ShutdownRequest) String() string
func (*ShutdownRequest) XXX_DiscardUnknown ¶
func (m *ShutdownRequest) XXX_DiscardUnknown()
func (*ShutdownRequest) XXX_Marshal ¶
func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShutdownRequest) XXX_Merge ¶
func (m *ShutdownRequest) XXX_Merge(src proto.Message)
func (*ShutdownRequest) XXX_Size ¶
func (m *ShutdownRequest) XXX_Size() int
func (*ShutdownRequest) XXX_Unmarshal ¶
func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error
type UnimplementedNyaaServer ¶
type UnimplementedNyaaServer struct { }
UnimplementedNyaaServer can be embedded to have forward compatible implementations.
func (*UnimplementedNyaaServer) CurrentResults ¶
func (*UnimplementedNyaaServer) CurrentResults(ctx context.Context, req *CurrentResultsRequest) (*CurrentResultsReply, error)
func (*UnimplementedNyaaServer) Ping ¶
func (*UnimplementedNyaaServer) Ping(ctx context.Context, req *PingRequest) (*PingReply, error)
func (*UnimplementedNyaaServer) Search ¶
func (*UnimplementedNyaaServer) Search(ctx context.Context, req *SearchRequest) (*SearchReply, error)
func (*UnimplementedNyaaServer) Shutdown ¶
func (*UnimplementedNyaaServer) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownReply, error)