yougoclient

package module
v0.0.0-...-ffe412b Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 15 Imported by: 0

README

yougoclient

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentSearch      string
	CurrentSearchIndex = 0
	ClientList         []*Users
	PASSFLAG           = 0
	UserSearch         []*Respond
	UserRequest        string
	AmountOfUsers      = 0
	FinishedSearch     = false
)

Functions

func CreateClient

func CreateClient(ctx context.Context, config *oauth2.Config) *http.Client

func DeleteUser

func DeleteUser(name string)

*Searches linearly through session clients and deletes selected username

func GetTokenFromFile

func GetTokenFromFile(filename string) (*oauth2.Token, error)

func GetTokenFromWeb

func GetTokenFromWeb(config *oauth2.Config) *oauth2.Token

func HandleError

func HandleError(err error, message string) string

*ERROR HANDLER

func NewClient

func NewClient()

func NewUser

func NewUser(name string)

*Creates user struct and appends to session clients slice

func SaveToken

func SaveToken(filename string, token *oauth2.Token)

func SearchQuery

func SearchQuery(service *youtube.Service, search string) map[string]string

*YOUTUBE QUERY FUNCTION

func TokenCacheFile

func TokenCacheFile() (string, error)

Types

type RequestResponseFormat

type RequestResponseFormat struct {
	Message string `json:"message"`
}

type Respond

type Respond struct {
	VideoID      string
	ThumbnailURL string
	VideoTitle   string
}

Respond used for storing video information

type SearchRequest

type SearchRequest struct {
	ID   string
	User string
}

SearchRequest used for user search

type UserAdd

type UserAdd struct {
	ID string
}

type Users

type Users struct {
	UserIndex   int        `json:"UserIndex"`
	UserName    string     `json:"UserName"`
	Searches    []*Respond `json:"Searches"`
	SessionTime int        `json:"SessionTime"`
}

User struct for user presets

func RelatedVideoGenerate

func RelatedVideoGenerate(service *youtube.Service, videoPass map[string]string) *Users

Function loops through queried videos and makes

*another request for more related videos.

func (*Users) AddUser

func (h *Users) AddUser(w http.ResponseWriter, r *http.Request)

func (*Users) SearchHandler

func (h *Users) SearchHandler(w http.ResponseWriter, r *http.Request)

func (*Users) ServeArray

func (h *Users) ServeArray(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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