config

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoogleMapsStyle = []string{
	"element:geometry|color:0x242f3e",
	"element:labels.text.fill|color:0x746855",
	"element:labels.text.stroke|color:0x242f3e",
	"feature:administrative.locality|element:labels.text.fill|color:0xd59563",
	"feature:poi|element:labels.text.fill|color:0xd59563",
	"feature:poi.park|element:geometry|color:0x263c3f",
	"feature:poi.park|element:labels.text.fill|color:0x6b9a76",
	"feature:road|element:geometry|color:0x38414e",
	"feature:road|element:geometry.stroke|color:0x212a37",
	"feature:road|element:labels.text.fill|color:0x9ca5b3",
	"feature:road.highway|element:geometry|color:0x746855",
	"feature:road.highway|element:geometry.stroke|color:0x1f2835",
	"feature:road.highway|element:labels.text.fill|color:0xf3d19c",
	"feature:transit|element:geometry|color:0x2f3948",
	"feature:transit.station|element:labels.text.fill|color:0xd59563",
	"feature:water|element:geometry|color:0x17263c",
	"feature:water|element:labels.text.fill|color:0x515c6d",
	"feature:water|element:labels.text.stroke|color:0x17263c&size=480x360",
}
View Source
var HelpMessages = []string{
	"!commands: List more commands you can use",
	"!commands: List more commands you can use",
	"!commands: List more commands you can use",
	"!guess: Guess which state we are in",
	"!leaderboard: See who has the most miles",
	"!location: Get the current location",
	"!miles: See your current miles",
	"!report: Report a stream issue (frozen, no audio, etc)",
	"!state: Get the state we are currently in",
	"!sunset: Get time until sunset (on the day of filming)",
	"!survey: Fill out a survey and help the stream",
	"!timewarp: Magically warp to a new moment in time",
}

HelpMessages are all of the different things !help can return

View Source
var IgnoredUsers = []string{}/* 106 elements not displayed */

TODO: this should load from a config file IgnoredUsers are users who shouldn't be in the running for miles https://twitchinsights.net/bots

View Source
var TimestampsToTry = []string{
	"000",
	"015",
	"030",
	"045",
	"100",
	"115",
	"130",
	"145",
	"200",
	"215",
	"230",
	"245",
}

these are different timestamps we have screenshots prepared for the "000" corresponds to 0m0s, "130" corresponds to 1m30s

Functions

func UserIsAdmin

func UserIsAdmin(username string) bool

UserIsAdmin returns true if a given user runs the channel it's used to restrict admin features

func UserIsIgnored

func UserIsIgnored(user string) bool

UserIsIgnored returns true if a given user should be ignored

Types

type TripbotConfig

type TripbotConfig struct {
	Environment string `required:"true" envconfig:"ENV"`
	ServerType  string `default:"tripbot"`

	// ChannelName is the username of the stream
	ChannelName string `required:"true" envconfig:"CHANNEL_NAME"`
	// OutputChannel is the stream to which the bot will speak
	OutputChannel string
	// BotUsername is the username of the bot
	BotUsername string `required:"true" envconfig:"BOT_USERNAME"`
	// ExternalURL is the where the bot's HTTP server can be reached
	ExternalURL string `required:"true" envconfig:"EXTERNAL_URL"`
	// GoogleProjectID is the Google Cloud project ID
	GoogleProjectID string `required:"true" envconfig:"GOOGLE_APPS_PROJECT_ID"`
	// GoogleMapsAPIKey is the API key with which we access Google Maps
	GoogleMapsAPIKey string `required:"true" envconfig:"GOOGLE_MAPS_API_KEY"`
	// ReadOnly is used to prevent writing some things to the DB
	ReadOnly bool `default:"false" envconfig:"READ_ONLY"`
	// Verbose determines output verbosity
	Verbose bool `default:"false" envconfig:"VERBOSE"`

	// VideoDir is where the videos live
	VideoDir string `default:"/opt/data/Dashcam/_all" envconfig:"VIDEO_DIR"`

	// MapsOutputDir is where generated maps will be stored
	MapsOutputDir string `default:"/opt/data/maps" envconfig:"MAPS_OUTPUT_DIR"`

	// TripbotPidFile is where the tripbot PID is written
	TripbotPidFile string `default:"/opt/data/run/tripbot.pid" envconfig:"TRIPBOT_PIDFILE"`

	// DisableTwitchWebhooks disables receiving webhooks from Twitch (new followers for instance)
	DisableTwitchWebhooks bool `default:"false" envconfig:"DISABLE_TWITCH_WEBHOOKS"`

	// TripbotHttpAuth is used to authenticate users to the HTTP server
	TripbotHttpAuth string `required:"true" envconfig:"TRIPBOT_HTTP_AUTH"`
	// TripbotServerPort is used to specify the port on which the webserver runs
	TripbotServerPort string `default:"8080" envconfig:"TRIPBOT_SERVER_PORT"`
	// VlcServerHost is used to specify the host for the VLC webserver
	VlcServerHost string `required:"true" envconfig:"VLC_SERVER_HOST"`
}
var Conf *TripbotConfig

func LoadTripbotConfig

func LoadTripbotConfig() *TripbotConfig

func (TripbotConfig) IsDevelopment

func (c TripbotConfig) IsDevelopment() bool

func (TripbotConfig) IsProduction

func (c TripbotConfig) IsProduction() bool

func (TripbotConfig) IsStaging

func (c TripbotConfig) IsStaging() bool

func (TripbotConfig) IsTesting

func (c TripbotConfig) IsTesting() bool

Jump to

Keyboard shortcuts

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