social

package
v0.0.0-...-519d529 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const FeaturedChannelsUrl = "https://api.furious.pro/featuredchannels/bot"

Variables

This section is empty.

Functions

func NewSocialController

func NewSocialController(twitchClientID, twitchClientSecret, twitchCallback, twitterKey, twitterSecret, twitterCallback, socialAuthURL, socialAuthKey, featuredChannelsKey string, b *common.Controller, router *httprouter.Router)

NewSocialController will return a new social controller

Types

type AuthErrorResponse

type AuthErrorResponse struct {
	Status  int    `json:"status,omitempty"`
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
}

type Controller

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

Controller holds all the info and methods

func (Controller) TwitchCheckForAuth

func (sc Controller) TwitchCheckForAuth(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitchCheckForAuth will check if there is an access token available. It doesn't necessairly say if it's expired or invalid

func (Controller) TwitchDeleteToken

func (sc Controller) TwitchDeleteToken(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitchDeleteToken will delete and revoke the twitch token

func (Controller) TwitchExecuteTemplate

func (sc Controller) TwitchExecuteTemplate(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitchExecuteTemplate will execute the template string given via config

func (Controller) TwitchGetSettings

func (sc Controller) TwitchGetSettings(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitchGetSettings returns settings

func (Controller) TwitchPlayCommercial

func (sc Controller) TwitchPlayCommercial(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (Controller) TwitchSetSettings

func (sc Controller) TwitchSetSettings(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

TwitchSetSettings sets the settings

func (Controller) TwitchUpdateInfo

func (sc Controller) TwitchUpdateInfo(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitchUpdateInfo will update the game and title for the connected twitch account

func (Controller) TwitterAddTemplate

func (sc Controller) TwitterAddTemplate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

TwitterAddTemplate will add a template to redis

func (Controller) TwitterCheckForAuth

func (sc Controller) TwitterCheckForAuth(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitterCheckForAuth will query socialAuth service is twitch authentication data exists. A true here doesn't necessairly mean that the data is valid but only that it exists

func (Controller) TwitterDeleteTemplate

func (sc Controller) TwitterDeleteTemplate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

TwitterDeleteTemplate will delete a template given by the index

func (Controller) TwitterDeleteToken

func (sc Controller) TwitterDeleteToken(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitterDeleteToken will tell socialAuth to delete the twitter auth data

func (Controller) TwitterGetSettings

func (sc Controller) TwitterGetSettings(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitterGetSettings is used to get settings for twitter

func (Controller) TwitterGetTemplates

func (sc Controller) TwitterGetTemplates(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitterGetTemplates will return all templates from redis

func (Controller) TwitterSendUpdate

func (sc Controller) TwitterSendUpdate(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

TwitterSendUpdate will send the update tweet at the start of a new run

func (Controller) TwitterSetSettings

func (sc Controller) TwitterSetSettings(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

TwitterSetSettings is used to set settings for twitter

func (Controller) UpdateFeaturedChannels

func (sc Controller) UpdateFeaturedChannels() error

type TwitchResponse

type TwitchResponse struct {
	AccessToken  string   `json:"access_token" bson:"accessToken"`
	RefreshToken string   `json:"refresh_token" bson:"refreshToken"`
	ExpiresIn    int      `json:"expires_in" bson:"expiresIn"`
	Scope        []string `json:"scope" bson:"scope"`
	InsertDate   time.Time
	ChannelID    string
}

TwitchResponse is the response returned from the twitch servers for a access token

type TwitchSettings

type TwitchSettings struct {
	Update         bool   `json:"update"`
	Viewers        bool   `json:"viewers"`
	TemplateString string `json:"templateString"`
}

TwitchSettings defines the settings for twitch integration

type TwitterSettings

type TwitterSettings struct {
	SendTweets bool `json:"sendTweets"`
}

TwitterSettings contains the settings for Twitter

Jump to

Keyboard shortcuts

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