Documentation
¶
Index ¶
- Constants
- func CallGet(endpoint string) ([]byte, *model.AppError)
- func NewNotificationsEmail(data *model.UserNotifications) (string, string, *model.AppError)
- type App
- func (app *App) Close()
- func (a *App) CrawlSoftware(notificationCh chan<- *model.Notification, software model.Software)
- func (a *App) CrawlSoftwares() *model.AppError
- func (a *App) DispatchNotifications() chan *model.Notification
- func (a *App) Housekeeping() *model.AppError
- func (a *App) LoadCrawlers()
- func (a *App) LoadDefaultData() *model.AppError
- type Confirmation
- type Crawler
- type CrawlerGithub
- type DefaultData
- type EmailClient
- type Runner
Constants ¶
const ( // GithubHostname define the hostname for github urls GithubHostname = "github.com" // GithubAPIURL define the api URL for github GithubAPIURL = "https://api.github.com" )
const (
// TemplateEmailNotificationsFile define the path to the EmailNotification template file
TemplateEmailNotificationsFile = "templates/email_notifications.gohtml"
)
Variables ¶
This section is empty.
Functions ¶
func NewNotificationsEmail ¶
NewNotificationsEmail email
Types ¶
type App ¶
type App struct {
Config *conf.Config
Logger *clog.Logger
Store store.Store
Runner *Runner
EmailClient *EmailClient
Crawlers map[string]Crawler
IsRunning struct {
Crawler bool
}
ErrorCh chan *model.AppError
}
App structure
func (*App) CrawlSoftware ¶
func (a *App) CrawlSoftware(notificationCh chan<- *model.Notification, software model.Software)
CrawlSoftware check latest software version and push a new notification in a channel
func (*App) CrawlSoftwares ¶
CrawlSoftwares get all softwares and get latest version to compare
func (*App) DispatchNotifications ¶
func (a *App) DispatchNotifications() chan *model.Notification
DispatchNotifications listen for any new notification and dispatch the notification to users by email
func (*App) Housekeeping ¶
Housekeeping clean up databse, reindex database, remove unused data, email unverified users
func (*App) LoadCrawlers ¶
func (a *App) LoadCrawlers()
LoadCrawlers creates the crawlers and add push them into the app
func (*App) LoadDefaultData ¶
LoadDefaultData save the first system user and load the predifined softwares and categories
type Crawler ¶
Crawler define all the required function for a version crawler
func NewCrawlerGithub ¶
NewCrawlerGithub create a new crawler for github
type CrawlerGithub ¶
type CrawlerGithub struct {
// contains filtered or unexported fields
}
CrawlerGithub is the struct used to crawl github repositories
func (*CrawlerGithub) FetchVersion ¶
FetchVersion fetches latest version of the specified github repo
type DefaultData ¶
type DefaultData struct {
Softwares []struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Website string `yaml:"website"`
Repository string `yaml:"repository"`
RepositoryType string `yaml:"repository_type"`
Categories []string `yaml:"categories"`
} `yaml:"softwares"`
}
DefaultData struct
type EmailClient ¶
type EmailClient struct {
// contains filtered or unexported fields
}
EmailClient struct