youtube

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_youtube_proto protoreflect.FileDescriptor

Functions

func NewYoutubeEndpoints

func NewYoutubeEndpoints() []*api.Endpoint

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

Jump to

Keyboard shortcuts

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