rpc

package
v0.0.0-...-57ee466 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package rpc is a generated protocol buffer package.

It is generated from these files:

defs.proto

It has these top-level messages:

ID
Nothing
Query
SearchResult
YouTubeResult
YouTubeSnippet
Thumbnail
YouTubeID
SearchResults

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGenIDServer

func RegisterGenIDServer(s *grpc.Server, srv GenIDServer)

func RegisterSearchServer

func RegisterSearchServer(s *grpc.Server, srv SearchServer)

Types

type GID

type GID int

func NewGenID

func NewGenID() (*GID, error)

func (*GID) NewID

func (gi *GID) NewID(ctx context.Context, _ *Nothing) (*ID, error)

func (*GID) ServeHTTP

func (gi *GID) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GenIDClient

type GenIDClient interface {
	NewID(ctx context.Context, in *Nothing, opts ...grpc.CallOption) (*ID, error)
}

func NewGenIDClient

func NewGenIDClient(cc *grpc.ClientConn) GenIDClient

type GenIDServer

type GenIDServer interface {
	NewID(context.Context, *Nothing) (*ID, error)
}

type ID

type ID struct {
	Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
}

func (*ID) Descriptor

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

func (*ID) GetValue

func (m *ID) GetValue() string

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) Reset

func (m *ID) Reset()

func (*ID) String

func (m *ID) String() string

type Nothing

type Nothing struct {
}

func (*Nothing) Descriptor

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

func (*Nothing) ProtoMessage

func (*Nothing) ProtoMessage()

func (*Nothing) Reset

func (m *Nothing) Reset()

func (*Nothing) String

func (m *Nothing) String() string

type Query

type Query struct {
	Keywords          string `protobuf:"bytes,1,opt,name=keywords" json:"keywords,omitempty"`
	MaxPages          int32  `protobuf:"varint,2,opt,name=maxPages" json:"maxPages,omitempty"`
	MaxResultsPerPage int32  `protobuf:"varint,3,opt,name=maxResultsPerPage" json:"maxResultsPerPage,omitempty"`
}

func ExtractQuery

func ExtractQuery(ctx context.Context, r *http.Request) (*Query, error)

func (*Query) Descriptor

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

func (*Query) GetKeywords

func (m *Query) GetKeywords() string

func (*Query) GetMaxPages

func (m *Query) GetMaxPages() int32

func (*Query) GetMaxResultsPerPage

func (m *Query) GetMaxResultsPerPage() int32

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) String

func (m *Query) String() string
type Search struct {
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(opts ...SearchInitOption) (*Search, error)

func (*Search) SearchIt

func (ss *Search) SearchIt(ctx context.Context, q *Query) (*SearchResults, error)

func (*Search) ServeHTTP

func (ss *Search) ServeHTTP(w http.ResponseWriter, r *http.Request)

And for HTTP based RPCs

type SearchClient

type SearchClient interface {
	SearchIt(ctx context.Context, in *Query, opts ...grpc.CallOption) (*SearchResults, error)
}

func NewSearchClient

func NewSearchClient(cc *grpc.ClientConn) SearchClient

type SearchInitOption

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

func WithYouTubeAPIKey

func WithYouTubeAPIKey(apiKey string) SearchInitOption

type SearchResult

type SearchResult struct {
	Index uint64           `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	Items []*YouTubeResult `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"`
	Err   string           `protobuf:"bytes,3,opt,name=err" json:"err,omitempty"`
}

func (*SearchResult) Descriptor

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

func (*SearchResult) GetErr

func (m *SearchResult) GetErr() string

func (*SearchResult) GetIndex

func (m *SearchResult) GetIndex() uint64

func (*SearchResult) GetItems

func (m *SearchResult) GetItems() []*YouTubeResult

func (*SearchResult) ProtoMessage

func (*SearchResult) ProtoMessage()

func (*SearchResult) Reset

func (m *SearchResult) Reset()

func (*SearchResult) String

func (m *SearchResult) String() string

type SearchResults

type SearchResults struct {
	Results []*SearchResult `protobuf:"bytes,1,rep,name=Results" json:"Results,omitempty"`
}

func (*SearchResults) Descriptor

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

func (*SearchResults) GetResults

func (m *SearchResults) GetResults() []*SearchResult

func (*SearchResults) ProtoMessage

func (*SearchResults) ProtoMessage()

func (*SearchResults) Reset

func (m *SearchResults) Reset()

func (*SearchResults) String

func (m *SearchResults) String() string

type SearchServer

type SearchServer interface {
	SearchIt(context.Context, *Query) (*SearchResults, error)
}

type Thumbnail

type Thumbnail struct {
	Height int64  `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
	Width  int64  `protobuf:"varint,2,opt,name=width" json:"width,omitempty"`
	Url    string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"`
}

func (*Thumbnail) Descriptor

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

func (*Thumbnail) GetHeight

func (m *Thumbnail) GetHeight() int64

func (*Thumbnail) GetUrl

func (m *Thumbnail) GetUrl() string

func (*Thumbnail) GetWidth

func (m *Thumbnail) GetWidth() int64

func (*Thumbnail) ProtoMessage

func (*Thumbnail) ProtoMessage()

func (*Thumbnail) Reset

func (m *Thumbnail) Reset()

func (*Thumbnail) String

func (m *Thumbnail) String() string

type YouTubeID

type YouTubeID struct {
	Kind       string `protobuf:"bytes,1,opt,name=kind" json:"kind,omitempty"`
	VideoId    string `protobuf:"bytes,2,opt,name=videoId" json:"videoId,omitempty"`
	PlaylistId string `protobuf:"bytes,3,opt,name=playlistId" json:"playlistId,omitempty"`
}

func (*YouTubeID) Descriptor

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

func (*YouTubeID) GetKind

func (m *YouTubeID) GetKind() string

func (*YouTubeID) GetPlaylistId

func (m *YouTubeID) GetPlaylistId() string

func (*YouTubeID) GetVideoId

func (m *YouTubeID) GetVideoId() string

func (*YouTubeID) ProtoMessage

func (*YouTubeID) ProtoMessage()

func (*YouTubeID) Reset

func (m *YouTubeID) Reset()

func (*YouTubeID) String

func (m *YouTubeID) String() string

type YouTubeResult

type YouTubeResult struct {
	ItemId  *ID             `protobuf:"bytes,1,opt,name=itemId" json:"itemId,omitempty"`
	Etag    string          `protobuf:"bytes,2,opt,name=etag" json:"etag,omitempty"`
	Id      *YouTubeID      `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"`
	Kind    string          `protobuf:"bytes,4,opt,name=kind" json:"kind,omitempty"`
	Snippet *YouTubeSnippet `protobuf:"bytes,5,opt,name=snippet" json:"snippet,omitempty"`
}

func (*YouTubeResult) Descriptor

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

func (*YouTubeResult) GetEtag

func (m *YouTubeResult) GetEtag() string

func (*YouTubeResult) GetId

func (m *YouTubeResult) GetId() *YouTubeID

func (*YouTubeResult) GetItemId

func (m *YouTubeResult) GetItemId() *ID

func (*YouTubeResult) GetKind

func (m *YouTubeResult) GetKind() string

func (*YouTubeResult) GetSnippet

func (m *YouTubeResult) GetSnippet() *YouTubeSnippet

func (*YouTubeResult) ProtoMessage

func (*YouTubeResult) ProtoMessage()

func (*YouTubeResult) Reset

func (m *YouTubeResult) Reset()

func (*YouTubeResult) String

func (m *YouTubeResult) String() string

type YouTubeSnippet

type YouTubeSnippet struct {
	ChannelId    string                `protobuf:"bytes,1,opt,name=channelId" json:"channelId,omitempty"`
	ChannelTitle string                `protobuf:"bytes,2,opt,name=channelTitle" json:"channelTitle,omitempty"`
	Description  string                `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"`
	PublishedAt  string                `protobuf:"bytes,4,opt,name=publishedAt" json:"publishedAt,omitempty"`
	Thumbnails   map[string]*Thumbnail `` /* 140-byte string literal not displayed */
	Title        string                `protobuf:"bytes,6,opt,name=title" json:"title,omitempty"`
}

func (*YouTubeSnippet) Descriptor

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

func (*YouTubeSnippet) GetChannelId

func (m *YouTubeSnippet) GetChannelId() string

func (*YouTubeSnippet) GetChannelTitle

func (m *YouTubeSnippet) GetChannelTitle() string

func (*YouTubeSnippet) GetDescription

func (m *YouTubeSnippet) GetDescription() string

func (*YouTubeSnippet) GetPublishedAt

func (m *YouTubeSnippet) GetPublishedAt() string

func (*YouTubeSnippet) GetThumbnails

func (m *YouTubeSnippet) GetThumbnails() map[string]*Thumbnail

func (*YouTubeSnippet) GetTitle

func (m *YouTubeSnippet) GetTitle() string

func (*YouTubeSnippet) ProtoMessage

func (*YouTubeSnippet) ProtoMessage()

func (*YouTubeSnippet) Reset

func (m *YouTubeSnippet) Reset()

func (*YouTubeSnippet) String

func (m *YouTubeSnippet) String() string

Jump to

Keyboard shortcuts

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