Documentation ¶
Index ¶
- type FlowOption
- func CSVFirstFieldOnlySource(input io.Reader) FlowOption
- func CSVSink(output io.Writer, columns *[]string) FlowOption
- func JSONLinesSink(output io.Writer) FlowOption
- func NullSink() FlowOption
- func SingleStringSource(input string) FlowOption
- func TableSink(output io.Writer, columns *[]string) FlowOption
- type Item
- type MultiErrors
- type Toolkit
- func (tk *Toolkit) AddVideoToPlaylist(playlistId string, opts ...FlowOption) error
- func (tk *Toolkit) DeletePlaylist(playlistId string) error
- func (tk *Toolkit) LastUploads(since time.Time, opts ...FlowOption) error
- func (tk *Toolkit) NewPlaylist(title string) (string, error)
- func (tk *Toolkit) Playlist(playlistId string, opts ...FlowOption) error
- func (tk *Toolkit) Playlists(opts ...FlowOption) error
- func (tk *Toolkit) SetLogWriter(output io.Writer)
- func (tk *Toolkit) SetService(service YoutubeService)
- func (tk *Toolkit) Subscribe(opts ...FlowOption) error
- func (tk *Toolkit) Subscriptions(opts ...FlowOption) error
- func (tk *Toolkit) Unsubscribe(channelId string) error
- type YoutubeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlowOption ¶
type FlowOption func(*flowconfig)
func CSVFirstFieldOnlySource ¶
func CSVFirstFieldOnlySource(input io.Reader) FlowOption
CSVFirstFieldOnlySource sets a CSV reader as source and emit only the first field/column (or the entire line if the input isn't a proper CSV)
func CSVSink ¶
func CSVSink(output io.Writer, columns *[]string) FlowOption
CSVSink sets a CSV writer as sink. The columns param selects the fields of Item to be written in the CSV output.
func JSONLinesSink ¶
func JSONLinesSink(output io.Writer) FlowOption
JSONLinesSink sets a JSON Lines as sink.
func SingleStringSource ¶
func SingleStringSource(input string) FlowOption
SingleStringSource sets the source to only emit the param input string.
type MultiErrors ¶
type MultiErrors []error
MultiErrors is used when one error is not enough
func (MultiErrors) Error ¶
func (e MultiErrors) Error() string
type Toolkit ¶
type Toolkit struct {
// contains filtered or unexported fields
}
func NewWithService ¶
func NewWithService(svc YoutubeService) *Toolkit
func (*Toolkit) AddVideoToPlaylist ¶
func (tk *Toolkit) AddVideoToPlaylist(playlistId string, opts ...FlowOption) error
AddVideoToPlaylist adds videos to a playlist. Flow: source and sink are required
func (*Toolkit) DeletePlaylist ¶
DeletePlaylist deletes a user playlist.
func (*Toolkit) LastUploads ¶
func (tk *Toolkit) LastUploads(since time.Time, opts ...FlowOption) error
CSVLastUploads gets the latest channels' video uploads since the time argument. Videos are sorted by the published date (oldest first). Flow: source and sink are required
func (*Toolkit) NewPlaylist ¶
NewPlaylist creates a new private playlist. Returns the playlist ID or error.
func (*Toolkit) Playlist ¶
func (tk *Toolkit) Playlist(playlistId string, opts ...FlowOption) error
Playlist gets a playlist's videos. Flow: only sink is required
func (*Toolkit) Playlists ¶
func (tk *Toolkit) Playlists(opts ...FlowOption) error
Playlists gets all user playlists. Flow: only sink is required
func (*Toolkit) SetLogWriter ¶
func (*Toolkit) SetService ¶
func (tk *Toolkit) SetService(service YoutubeService)
func (*Toolkit) Subscribe ¶
func (tk *Toolkit) Subscribe(opts ...FlowOption) error
Subscribe adds channels to user subscriptions. Flow: source and sink are required
func (*Toolkit) Subscriptions ¶
func (tk *Toolkit) Subscriptions(opts ...FlowOption) error
Subscriptions gets all channels from user subscription. Flow: only sink is required
func (*Toolkit) Unsubscribe ¶
Unsubscribe removes channel from user subscriptions.
type YoutubeService ¶
type YoutubeService interface { SubscriptionsList(out chan<- *bigg.Sub) error SubscriptionInsert(channelId string) (*bigg.Sub, error) SubscriptionDelete(channelId string) error PlaylistsList(out chan<- *bigg.Playlist) error PlaylistInsert(title string) (*bigg.Playlist, error) PlaylistDelete(playlistId string) error PlaylistItemsList(id string, filter func(*bigg.PlaylistItem) (bool, error), out chan<- *bigg.PlaylistItem) error PlaylistItemsInsert(playlistId, videoId string) (*bigg.PlaylistItem, error) GetChannelInfo(id string) (*bigg.Channel, error) }