tlcbroadcast

package module
v0.0.0-...-669782b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindExe

func FindExe(desktopfile string) string

func GetAuthCode

func GetAuthCode(authurl string) string

func PrintErrorResponse

func PrintErrorResponse(resp *http.Response, err error)

func PrintResponse

func PrintResponse(resp *http.Response)

func YtGetClient

func YtGetClient() *youtube.Service

func YtGetVideos

func YtGetVideos(ytclient *youtube.Service) *[]YtVideo

Types

type AuthTokenHandler

type AuthTokenHandler struct {
	Cmd    *exec.Cmd
	Server *http.Server
	Code   string
	Stop   chan bool
}

func (*AuthTokenHandler) ServeHTTP

func (self *AuthTokenHandler) ServeHTTP(res http.ResponseWriter, req *http.Request)

type DcCategory

type DcCategory struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type DcCategoryList

type DcCategoryList struct {
	Categories []DcCategory `json:"categories"`
}

type DcCategoryResp

type DcCategoryResp struct {
	CategoryList DcCategoryList `json:"category_list"`
}

type DcClient

type DcClient struct {
	ApiKey      string `json:"api_key"`
	ApiUsername string `json:"api_username"`
	WebSite     string
	Categories  *[]DcCategory
	Client      *http.Client
}

func DcGetClient

func DcGetClient(website string) *DcClient

func (*DcClient) CheckId

func (self *DcClient) CheckId(id string) bool

func (*DcClient) Get

func (self *DcClient) Get(uri string) (*http.Response, error)

func (*DcClient) GetCategories

func (self *DcClient) GetCategories() *[]DcCategory

func (*DcClient) GetCategoryId

func (self *DcClient) GetCategoryId(slug string) int64

func (*DcClient) Post

func (self *DcClient) Post(uri string, body string) (*http.Response, error)

func (*DcClient) Upload

func (self *DcClient) Upload(videos *[]YtVideo) bool

type DcTopic

type DcTopic struct {
	Title      string `json:"title"`
	Raw        string `json:"raw"`
	CategoryId int64  `json:"category"`
	ExternalId string `json:"external_id"`
}

type WpBasicAuth

type WpBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type WpBasicAuthClient

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

func (*WpBasicAuthClient) Get

func (self *WpBasicAuthClient) Get(url string) (resp *http.Response, err error)

func (*WpBasicAuthClient) Post

func (self *WpBasicAuthClient) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)

type WpCategory

type WpCategory struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type WpClient

type WpClient struct {
	Client WpHttpClient
	Urls   WpUrls
	Me     *WpMe
}

func WpGetClient

func WpGetClient() *WpClient

func WpGetClientBasicAuth

func WpGetClientBasicAuth() *WpClient

func WpGetClientOauth

func WpGetClientOauth() *WpClient

func (*WpClient) GetCategory

func (self *WpClient) GetCategory(website string, categoryname string) *WpCategory

func (*WpClient) GetMe

func (self *WpClient) GetMe(website string) *WpMe

func (*WpClient) GetPosts

func (self *WpClient) GetPosts(website string, iparams map[string]string) *[]WpPostsRespPost

func (*WpClient) GetTag

func (self *WpClient) GetTag(website string, tagname string) *WpTag

func (*WpClient) NewCategory

func (self *WpClient) NewCategory(website string, categoryname string) *WpCategory

func (*WpClient) NewTag

func (self *WpClient) NewTag(website string, tagname string) *WpTag

func (*WpClient) Post

func (self *WpClient) Post(website string, title string, content string, author string, tags string, categories string) bool

func (*WpClient) Upload

func (self *WpClient) Upload(website string, videos *[]YtVideo) bool

type WpConfig

type WpConfig struct {
	ClientId        string   `json:"client_id"`
	ClientSecret    string   `json:"client_secret"`
	RedirectUrls    []string `json:"redirect_urls"`
	RequestTokenUrl string   `json:"request_token_url"`
	AuthorizeUrl    string   `json:"authorize_url"`
	AuthenticateUrl string   `json:"authenticate_url"`
}

type WpHttpClient

type WpHttpClient interface {
	Get(url string) (resp *http.Response, err error)
	Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
}

type WpMe

type WpMe struct {
	Id          int64  `json:"ID"`
	UserName    string `json:"username"`
	PrimaryBlog int64  `json:"primary_blog"`
}

type WpPostsResp

type WpPostsResp struct {
	Posts []WpPostsRespPost `json:"posts"`
}

type WpPostsRespMeta

type WpPostsRespMeta struct {
	NextPage string `json:"next_page"`
}

type WpPostsRespPost

type WpPostsRespPost struct {
	Id         int64       `json:"ID"`
	Tags       interface{} `json:"tags"`
	Categories interface{} `json:"categories"`
}

func (*WpPostsRespPost) CheckCategory

func (self *WpPostsRespPost) CheckCategory(icategory string) bool

func (*WpPostsRespPost) CheckTag

func (self *WpPostsRespPost) CheckTag(itag string) bool

func (*WpPostsRespPost) GetCategories

func (self *WpPostsRespPost) GetCategories() []string

func (*WpPostsRespPost) GetTags

func (self *WpPostsRespPost) GetTags() []string

type WpTag

type WpTag struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type WpUrls

type WpUrls struct {
	MeUrlPathTemplate          string
	PostsUrlPathTemplate       string
	NewPostUrlPathTemplate     string
	TagUrlPathTemplate         string
	NewTagUrlPathTemplate      string
	CategoryUrlPathTemplate    string
	NewCategoryUrlPathTemplate string
}

type YtVideo

type YtVideo struct {
	Id          string
	Url         string
	PubTime     time.Time
	Title       string
	Description string
	Status      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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