-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.go
More file actions
39 lines (30 loc) · 894 Bytes
/
app.go
File metadata and controls
39 lines (30 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"context"
core "github.com/zaffri/left2deploy/lib"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
func (a *App) RepoSearch(githubToken string, searchTerm string) ([]core.RepoSearchResult, error) {
return core.RepoSearch(githubToken, searchTerm)
}
func (a *App) GetReportData(githubToken string, reportRequests []core.RepoSearchResult) (map[string]core.ReportResult, error) {
return core.GetReportData(githubToken, reportRequests)
}
func (a *App) StoreGithubToken(token string) (bool, error) {
return core.StoreSecret(token)
}
func (a *App) GetGithubToken() (string, error) {
return core.GetSecret()
}