app

package
v0.0.0-...-9ace066 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package app wraps all the functionality and keeps it out of cmd package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFileWatcher

func ConfigFileWatcher(watcher *fsnotify.Watcher, notifyConfigChange chan bool)

Types

type App

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

func NewApp

func NewApp(c ConfigStore, l logger.Logger) App

func (*App) Initialize

func (a *App) Initialize()

If any error happens - all features will be disabled

func (*App) RerunAuth

func (a *App) RerunAuth()

func (*App) Run

func (a *App) Run(notifyConfigChange chan bool, interrupts chan os.Signal)

type AuthStore

type AuthStore interface {
	StoreMeetupToken(m MeetupToken) error
	GetMeetupToken() (MeetupToken, error)
	StoreGoogleToken(g GoogleToken) error
	GetGoogleToken() (GoogleToken, error)
}

type BasicAuthStore

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

func NewBasicAuthStore

func NewBasicAuthStore(f string) BasicAuthStore

func (*BasicAuthStore) GetGoogleToken

func (b *BasicAuthStore) GetGoogleToken() (GoogleToken, error)

func (*BasicAuthStore) GetMeetupToken

func (b *BasicAuthStore) GetMeetupToken() (MeetupToken, error)

func (*BasicAuthStore) StoreGoogleToken

func (b *BasicAuthStore) StoreGoogleToken(g GoogleToken) error

func (*BasicAuthStore) StoreMeetupToken

func (b *BasicAuthStore) StoreMeetupToken(m MeetupToken) error

type BasicConfigStore

type BasicConfigStore struct {
	Filename string
}

func NewBasicConfigStore

func NewBasicConfigStore(f string) BasicConfigStore

func (BasicConfigStore) Get

func (b BasicConfigStore) Get() (Config, error)

type CalendarConfig

type CalendarConfig struct {
	CalendarID              string `yaml:"calendar_id"`
	CalendarEventInvitation string `yaml:"calendar_event_invitation"`
}

type Config

type Config struct {
	Authstore        string                `yaml:"authstore"`
	EventStoreFile   string                `yaml:"eventstore"`
	Features         Features              `yaml:"features"`
	Meetup           MeetupCredentials     `yaml:"meetup_credentials"`
	Google           GoogleCredentials     `yaml:"google_credentials"`
	Streamyard       StreamyardCredentials `yaml:"streamyard_credentials"`
	SpreadsheetStats string                `yaml:"spreadsheet_stats"`
	CalendarConfig   CalendarConfig        `yaml:"calendar_config"`
	MeetupConfig     MeetupConfig          `yaml:"meetup_config"`
	StreamyardConfig StreamyardConfig      `yaml:"streamyard_config"`
}

type ConfigStore

type ConfigStore interface {
	Get() (Config, error)
}

type FacebookAccess

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

func (FacebookAccess) ServeHTTP

func (f FacebookAccess) ServeHTTP(w http.ResponseWriter, r *http.Request)

type FacebookAuthorize

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

func (FacebookAuthorize) ServeHTTP

func (f FacebookAuthorize) ServeHTTP(w http.ResponseWriter, r *http.Request)

type FeatureControl

type FeatureControl struct {
	Enabled      bool `yaml:"enabled"`
	IdleDuration int  `yaml:"idle_duration"`
}

type Features

type Features struct {
	MeetupSync  MeetupFeatureControl `yaml:"meetup_sync"`
	AuthRefresh FeatureControl       `yaml:"auth_refresh"`
}

type GoogleAccess

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

func (GoogleAccess) ServeHTTP

func (g GoogleAccess) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GoogleAuthRefresher

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

func (GoogleAuthRefresher) Refresh

func (g GoogleAuthRefresher) Refresh() error

type GoogleAuthorize

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

func (GoogleAuthorize) ServeHTTP

func (g GoogleAuthorize) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GoogleCredentials

type GoogleCredentials struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
	Scope        string `yaml:"scope"`
	RedirectURI  string `yaml:"redirect_uri"`
}

type GoogleToken

type GoogleToken struct {
	RefreshToken string `yaml:"refresh_token"`
	AccessToken  string `yaml:"access_token"`
	ExpiryTime   int64  `yaml:"expiry_time"`
}

type MeetupAccess

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

func (MeetupAccess) ServeHTTP

func (m MeetupAccess) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MeetupAuthRefresher

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

func (MeetupAuthRefresher) Refresh

func (m MeetupAuthRefresher) Refresh() error

type MeetupAuthorize

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

func (MeetupAuthorize) ServeHTTP

func (m MeetupAuthorize) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MeetupConfig

type MeetupConfig struct {
	MeetupGroup      string            `yaml:"meetup_group"`
	OrganizerMapping map[string]string `yaml:"organizer_mapping"`
}

type MeetupCredentials

type MeetupCredentials struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
	RedirectURI  string `yaml:"redirect_uri"`
}

type MeetupFeatureControl

type MeetupFeatureControl struct {
	Enabled      bool                               `yaml:"enabled"`
	IdleDuration int                                `yaml:"idle_duration"`
	SubFeatures  eventstore.SubMeetupFeatureControl `yaml:"subfeatures"`
}

type MeetupToken

type MeetupToken struct {
	RefreshToken string `yaml:"refresh_token"`
	AccessToken  string `yaml:"access_token"`
	ExpiryTime   int64  `yaml:"expiry_time"`
}

type StreamyardConfig

type StreamyardConfig struct {
	UserID                   string `yaml:"user_id"`
	YoutubeDestination       string `yaml:"youtube_destination"`
	FacebookGroupDestination string `yaml:"facebook_group_destination"`
}

type StreamyardCredentials

type StreamyardCredentials struct {
	CSRFToken string `yaml:"csrf_token"`
	JWT       string `yaml:"jwt"`
}

Jump to

Keyboard shortcuts

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