mi-v1/cmd/mi/mi.go

31 lines
659 B
Go
Raw Permalink Normal View History

2020-01-11 18:38:50 +00:00
package main
import (
2020-01-11 20:18:59 +00:00
"net/http"
"github.com/McKael/madon/v2"
2020-01-11 18:38:50 +00:00
"github.com/dghubble/go-twitter/twitter"
"github.com/turnage/graw/reddit"
"gopkg.in/mxpv/patreon-go.v1"
r "gopkg.in/rethinkdb/rethinkdb-go.v6"
)
type Mi struct {
session *r.Session
mastodonClient *madon.Client
twitterClient *twitter.Client
redditBot reddit.Bot
patreonClient *patreon.Client
2020-01-11 20:18:59 +00:00
mux *http.ServeMux
pushers []Pusher
}
func (mi *Mi) RegisterPusher(p Pusher) {
mi.pushers = append(mi.pushers, p)
}
func (mi *Mi) RegisterRoutes() {
mi.mux.HandleFunc("/blog/refresh", mi.RefreshBlog)
2020-01-11 20:25:58 +00:00
mi.mux.HandleFunc("/.within/botinfo", botInfoPage)
2020-01-11 18:38:50 +00:00
}