Documentation ¶
Index ¶
- Variables
- func NewYoutubeEndpoints() []*api.Endpoint
- func RegisterYoutubeHandler(s server.Server, hdlr YoutubeHandler, opts ...server.HandlerOption) error
- type EmbedRequest
- type EmbedResponse
- func (*EmbedResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EmbedResponse) GetEmbedUrl() string
- func (x *EmbedResponse) GetHtmlScript() string
- func (x *EmbedResponse) GetLongUrl() string
- func (x *EmbedResponse) GetShortUrl() string
- func (*EmbedResponse) ProtoMessage()
- func (x *EmbedResponse) ProtoReflect() protoreflect.Message
- func (x *EmbedResponse) Reset()
- func (x *EmbedResponse) String() string
- type SearchRequest
- type SearchResponse
- type SearchResult
- func (*SearchResult) Descriptor() ([]byte, []int)deprecated
- func (x *SearchResult) GetBroadcasting() string
- func (x *SearchResult) GetChannelId() string
- func (x *SearchResult) GetChannelTitle() string
- func (x *SearchResult) GetDescription() string
- func (x *SearchResult) GetId() string
- func (x *SearchResult) GetKind() string
- func (x *SearchResult) GetPublishedAt() string
- func (x *SearchResult) GetTitle() string
- func (x *SearchResult) GetUrl() string
- func (*SearchResult) ProtoMessage()
- func (x *SearchResult) ProtoReflect() protoreflect.Message
- func (x *SearchResult) Reset()
- func (x *SearchResult) String() string
- type YoutubeHandler
- type YoutubeService
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_youtube_proto protoreflect.FileDescriptor
Functions ¶
func NewYoutubeEndpoints ¶
func RegisterYoutubeHandler ¶
func RegisterYoutubeHandler(s server.Server, hdlr YoutubeHandler, opts ...server.HandlerOption) error
Types ¶
type EmbedRequest ¶ added in v0.24.0
type EmbedRequest struct { // provide the youtube url e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0 Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
Embed a YouTube video
func (*EmbedRequest) Descriptor
deprecated
added in
v0.24.0
func (*EmbedRequest) Descriptor() ([]byte, []int)
Deprecated: Use EmbedRequest.ProtoReflect.Descriptor instead.
func (*EmbedRequest) GetUrl ¶ added in v0.24.0
func (x *EmbedRequest) GetUrl() string
func (*EmbedRequest) ProtoMessage ¶ added in v0.24.0
func (*EmbedRequest) ProtoMessage()
func (*EmbedRequest) ProtoReflect ¶ added in v0.24.0
func (x *EmbedRequest) ProtoReflect() protoreflect.Message
func (*EmbedRequest) Reset ¶ added in v0.24.0
func (x *EmbedRequest) Reset()
func (*EmbedRequest) String ¶ added in v0.24.0
func (x *EmbedRequest) String() string
type EmbedResponse ¶ added in v0.24.0
type EmbedResponse struct { // the full url LongUrl string `protobuf:"bytes,1,opt,name=long_url,json=longUrl,proto3" json:"long_url,omitempty"` // the short url ShortUrl string `protobuf:"bytes,2,opt,name=short_url,json=shortUrl,proto3" json:"short_url,omitempty"` // the embeddable link e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0 EmbedUrl string `protobuf:"bytes,3,opt,name=embed_url,json=embedUrl,proto3" json:"embed_url,omitempty"` // the script code HtmlScript string `protobuf:"bytes,4,opt,name=html_script,json=htmlScript,proto3" json:"html_script,omitempty"` // contains filtered or unexported fields }
func (*EmbedResponse) Descriptor
deprecated
added in
v0.24.0
func (*EmbedResponse) Descriptor() ([]byte, []int)
Deprecated: Use EmbedResponse.ProtoReflect.Descriptor instead.
func (*EmbedResponse) GetEmbedUrl ¶ added in v0.24.0
func (x *EmbedResponse) GetEmbedUrl() string
func (*EmbedResponse) GetHtmlScript ¶ added in v0.24.0
func (x *EmbedResponse) GetHtmlScript() string
func (*EmbedResponse) GetLongUrl ¶ added in v0.24.0
func (x *EmbedResponse) GetLongUrl() string
func (*EmbedResponse) GetShortUrl ¶ added in v0.24.0
func (x *EmbedResponse) GetShortUrl() string
func (*EmbedResponse) ProtoMessage ¶ added in v0.24.0
func (*EmbedResponse) ProtoMessage()
func (*EmbedResponse) ProtoReflect ¶ added in v0.24.0
func (x *EmbedResponse) ProtoReflect() protoreflect.Message
func (*EmbedResponse) Reset ¶ added in v0.24.0
func (x *EmbedResponse) Reset()
func (*EmbedResponse) String ¶ added in v0.24.0
func (x *EmbedResponse) String() string
type SearchRequest ¶
type SearchRequest struct { // Query to search for Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // contains filtered or unexported fields }
Search for videos on YouTube
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetQuery ¶
func (x *SearchRequest) GetQuery() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct { // List of results for the query Results []*SearchResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*SearchResponse) Descriptor
deprecated
func (*SearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) GetResults ¶
func (x *SearchResponse) GetResults() []*SearchResult
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) ProtoReflect ¶
func (x *SearchResponse) ProtoReflect() protoreflect.Message
func (*SearchResponse) Reset ¶
func (x *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (x *SearchResponse) String() string
type SearchResult ¶
type SearchResult struct { // id of the result Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // kind of result; "video", "channel", "playlist" Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` // title of the result Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // the result description Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // the channel id ChannelId string `protobuf:"bytes,5,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` // the channel title ChannelTitle string `protobuf:"bytes,6,opt,name=channel_title,json=channelTitle,proto3" json:"channel_title,omitempty"` // published at time PublishedAt string `protobuf:"bytes,7,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"` // if live broadcast then indicates activity. // none, upcoming, live, completed Broadcasting string `protobuf:"bytes,8,opt,name=broadcasting,proto3" json:"broadcasting,omitempty"` // the associated url Url string `protobuf:"bytes,9,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*SearchResult) Descriptor
deprecated
func (*SearchResult) Descriptor() ([]byte, []int)
Deprecated: Use SearchResult.ProtoReflect.Descriptor instead.
func (*SearchResult) GetBroadcasting ¶
func (x *SearchResult) GetBroadcasting() string
func (*SearchResult) GetChannelId ¶
func (x *SearchResult) GetChannelId() string
func (*SearchResult) GetChannelTitle ¶
func (x *SearchResult) GetChannelTitle() string
func (*SearchResult) GetDescription ¶
func (x *SearchResult) GetDescription() string
func (*SearchResult) GetId ¶
func (x *SearchResult) GetId() string
func (*SearchResult) GetKind ¶
func (x *SearchResult) GetKind() string
func (*SearchResult) GetPublishedAt ¶
func (x *SearchResult) GetPublishedAt() string
func (*SearchResult) GetTitle ¶
func (x *SearchResult) GetTitle() string
func (*SearchResult) GetUrl ¶
func (x *SearchResult) GetUrl() string
func (*SearchResult) ProtoMessage ¶
func (*SearchResult) ProtoMessage()
func (*SearchResult) ProtoReflect ¶
func (x *SearchResult) ProtoReflect() protoreflect.Message
func (*SearchResult) Reset ¶
func (x *SearchResult) Reset()
func (*SearchResult) String ¶
func (x *SearchResult) String() string
type YoutubeHandler ¶
type YoutubeHandler interface { Search(context.Context, *SearchRequest, *SearchResponse) error Embed(context.Context, *EmbedRequest, *EmbedResponse) error }
type YoutubeService ¶
type YoutubeService interface { Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) Embed(ctx context.Context, in *EmbedRequest, opts ...client.CallOption) (*EmbedResponse, error) }
func NewYoutubeService ¶
func NewYoutubeService(name string, c client.Client) YoutubeService
Click to show internal directories.
Click to hide internal directories.