ytlister

package module
v0.0.0-...-314abfe Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 9 Imported by: 0

README

ytlister

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListPlaylists

func ListPlaylists(service *youtube.Service) ([]*youtube.Playlist, error)

ListPlaylists returns all of the playlists associated with the user the service is created for

func ListenAndServe

func ListenAndServe(port string, version int) error

ListenAndServe provides the HTTP server handler

func NewYoutubeClient

func NewYoutubeClient(ctx context.Context, clientID, secret string, token *oauth2.Token) (*youtube.Service, error)

NewYoutubeClient creates an instance of the YouTube Service for the given user

func NewYoutubeOAuthConfig

func NewYoutubeOAuthConfig(clientID, secret string) *oauth2.Config

NewYoutubeOAuthConfig creates an OAuth2 configuration object with the needed YouTube scopes for the given client info

Types

type DB

type DB interface {
	// Create creates a new entity
	Create(thing Thing) error
	// Update updates a new entity
	Update(thing Thing) error
	// Delete deletes an existing thing
	Delete(id int) error
	// AllThings retrieves every thing
	AllThings() (things []Thing, err error)
	// ByID returns a single tea instance based on its ID
	ByID(id int) (t Thing, err error)
}

DB defines the interface needed by any database client

type GcpClient

type GcpClient struct {
	// contains filtered or unexported fields
}

GcpClient is the client struct

func NewGcpClient

func NewGcpClient(projectID string) (c *GcpClient, err error)

NewGcpClient creates a new GcpClient

func (*GcpClient) AllThings

func (c *GcpClient) AllThings() (things []Thing, err error)

AllThings retrieves every thing

func (*GcpClient) ByID

func (c *GcpClient) ByID(id int) (t Thing, err error)

ByID returns a single tea instance based on its ID

func (*GcpClient) Create

func (c *GcpClient) Create(thing Thing) error

Create creates a new entity

func (*GcpClient) Delete

func (c *GcpClient) Delete(id int) error

Delete deletes an existing thing

func (*GcpClient) Update

func (c *GcpClient) Update(thing Thing) error

Update updates a new entity

type Thing

type Thing struct {
	ID   int    `json:"id"`
	Type string `json:"type"`
}

Thing holds stuff

Directories

Path Synopsis
cmd
poc

Jump to

Keyboard shortcuts

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