Documentation ¶
Overview ¶
Package ytservice encapsulates all the YouTube API services
Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc
Index ¶
- Constants
- Variables
- type CellValue
- type Error
- type FieldSpec
- type Flag
- type Params
- func (this *Params) CheckFlags(command string) error
- func (this *Params) Commands() []string
- func (this *Params) Copy() *Params
- func (this *Params) Flags(command string) map[string]Flag
- func (this *Params) IsEmptyBroadcastStatus() bool
- func (this *Params) IsEmptyChannel() bool
- func (this *Params) IsEmptyContentOwner() bool
- func (this *Params) IsEmptyDescription() bool
- func (this *Params) IsEmptyLanguage() bool
- func (this *Params) IsEmptyQuery() bool
- func (this *Params) IsEmptyStream() bool
- func (this *Params) IsEmptyTitle() bool
- func (this *Params) IsEmptyVideo() bool
- func (this *Params) IsValidBroadcastStatus() bool
- func (this *Params) IsValidChannel() bool
- func (this *Params) IsValidContentOwner() bool
- func (this *Params) IsValidLanguage() bool
- func (this *Params) IsValidStream() bool
- func (this *Params) IsValidVideo() bool
- func (this *Params) Register(command string, setup func(*Params, *Table) error, ...) error
- func (this *Params) Save(filename string, perm os.FileMode) error
- type Row
- type Service
- type Table
- func (this *Table) ASCII(io io.Writer) error
- func (this *Table) AddColumn(key string)
- func (this *Table) AddColumnsForPart(part string) error
- func (this *Table) Append(items interface{}) error
- func (this *Table) CSV(io io.Writer) error
- func (this *Table) NewRow() *Row
- func (this *Table) NumberOfColumns() int
- func (this *Table) NumberOfRows() int
- func (this *Table) Parts() []string
- func (this *Table) RegisterPart(part string, fields []FieldSpec)
- func (this *Table) RemoveColumnsForPart(part string) error
- func (this *Table) SetColumns(columns []string)
Constants ¶
const ( FLAG_REQUIRED = 0x0000 FLAG_OPTIONAL = 0x0001 FLAG_STRING = 0x0010 FLAG_UINT = 0x0020 FLAG_ENUM = 0x0030 FLAG_VIDEO = 0x0040 FLAG_CHANNEL = 0x0050 FLAG_PLAYLIST = 0x0060 FLAG_LANGUAGE = 0x0070 )
const ( FIELD_STRING = iota FIELD_DATETIME FIELD_NUMBER FIELD_BOOLEAN )
Variables ¶
var ( ErrorMissingContentOwner = errors.New("Missing content owner parameter") ErrorInvalidServiceAccount = errors.New("Invalid service account") ErrorInvalidClientSecrets = errors.New("Invalid client secrets configuration") ErrorInvalidDefaults = errors.New("Invalid defaults file") ErrorCacheTokenRead = errors.New("Invalid Cache Token") ErrorCacheTokenWrite = errors.New("Unable to create cache token") ErrorTokenExchange = errors.New("Token Exchange Error") ErrorDenied = errors.New("Denied") ErrorResponse = errors.New("Bad Response") ErrorBadParameter = errors.New("Invalid Parameter") )
Enumeration of Errors
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct { ContentOwner *string `json:"contentowner,omitempty"` Channel *string `json:"channel,omitempty"` Video *string `json:"-"` Stream *string `json:"-"` MaxResults int64 `json:"-"` Query *string `json:"-"` BroadcastStatus *string `json:"-"` Language *string `json:"-"` Title *string `json:"-"` Description *string `json:"-"` SetupHook map[string]func(*Params, *Table) error // command -> SetupFunc ExecHook map[string]func(*Service, *Params, *Table) error // command -> ExecFunc FlagSpec map[string]map[string]Flag // command:flag -> Flag // contains filtered or unexported fields }
Params object stores all the parameters used for making API requests
func NewParamsFromJSON ¶
NewParamsFromJSON returns a params object from a JSON file
func (*Params) CheckFlags ¶
CheckFlags checks all parameters
func (*Params) IsEmptyBroadcastStatus ¶
Return boolean value which indicates an empty video parameter
func (*Params) IsEmptyChannel ¶
Return boolean value which indicates an empty channel
func (*Params) IsEmptyContentOwner ¶
Return boolean value which indicates if a content owner parameter is missing
func (*Params) IsEmptyDescription ¶
Return boolean value which indicates an empty title parameter
func (*Params) IsEmptyLanguage ¶
Return boolean value which indicates an empty language parameter
func (*Params) IsEmptyQuery ¶
Return boolean value which indicates an empty query
func (*Params) IsEmptyStream ¶
Return boolean value which indicates an empty stream parameter
func (*Params) IsEmptyTitle ¶
Return boolean value which indicates an empty title parameter
func (*Params) IsEmptyVideo ¶
Return boolean value which indicates an empty video parameter
func (*Params) IsValidBroadcastStatus ¶
Return boolean value which indicates a valid video parameter
func (*Params) IsValidChannel ¶
Return boolean value whichindicates a valid content owner setting
func (*Params) IsValidContentOwner ¶
Return boolean value which indicates a valid content owner setting
func (*Params) IsValidLanguage ¶
Return boolean value which indicates a valid language parameter
func (*Params) IsValidStream ¶
Return boolean value which indicates a valid stream parameter
func (*Params) IsValidVideo ¶
Return boolean value which indicates a valid video parameter
type Service ¶
type Service struct { // Data API API *youtube.Service // Partner API PAPI *youtubepartner.Service // Analytics API AAPI *youtubeanalytics.Service // Bulk Reporting API RAPI *youtubereporting.Service // Whether this is a service account ServiceAccount bool // The email address of the service account ServiceAccountEmail string // contains filtered or unexported fields }
Service object which contains the main context for calling the YouTube API
func NewYouTubeServiceFromClientSecretsJSON ¶
func NewYouTubeServiceFromClientSecretsJSON(clientsecrets string, tokencache string, debug bool) (*Service, error)
NewYouTubeServiceFromClientSecretsJSON returns a service object given client secrets details
func NewYouTubeServiceFromServiceAccountJSON ¶
NewYouTubeServiceFromServiceAccountJSON returns a service object given service account details
func (*Service) CallOptions ¶
func (this *Service) CallOptions() []googleapi.CallOption
CallOptions returns the array of call options
func (*Service) SetQuotaUser ¶
SetQuotaUser sets the quota user parameter for all API requests
func (*Service) SetTraceToken ¶
SetTraceToken sets the tracetoken parameter for all API requests
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table object
func (*Table) AddColumnsForPart ¶
func (*Table) NumberOfColumns ¶
func (*Table) NumberOfRows ¶
func (*Table) RegisterPart ¶
Register output formats