nyaa

package
v0.0.0-...-652cce4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package nyaa is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterNyaaHandler

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

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

func RegisterNyaaHandlerClient

func RegisterNyaaHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NyaaClient) error

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

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) Descriptor() ([]byte, []int)

func (*PingReply) GetMessage

func (m *PingReply) GetMessage() string

func (*PingReply) ProtoMessage

func (*PingReply) ProtoMessage()

func (*PingReply) Reset

func (m *PingReply) Reset()

func (*PingReply) String

func (m *PingReply) String() string

func (*PingReply) XXX_DiscardUnknown

func (m *PingReply) XXX_DiscardUnknown()

func (*PingReply) XXX_Marshal

func (m *PingReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PingReply) XXX_Merge

func (m *PingReply) XXX_Merge(src proto.Message)

func (*PingReply) XXX_Size

func (m *PingReply) XXX_Size() int

func (*PingReply) XXX_Unmarshal

func (m *PingReply) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Result) GetCategory

func (m *Result) GetCategory() string

func (*Result) GetDate

func (m *Result) GetDate() string

func (*Result) GetDownloads

func (m *Result) GetDownloads() uint32

func (*Result) GetLeechers

func (m *Result) GetLeechers() uint32
func (m *Result) GetLink() string

func (*Result) GetName

func (m *Result) GetName() string

func (*Result) GetSeeders

func (m *Result) GetSeeders() uint32

func (*Result) GetSize

func (m *Result) GetSize() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error

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) Ping

func (*UnimplementedNyaaServer) Search

func (*UnimplementedNyaaServer) Shutdown

Jump to

Keyboard shortcuts

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