Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
justlorain committed Mar 31, 2024
1 parent 21ef822 commit 70490fa
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"github.com/B1NARY-GR0UP/openalysis/storage"
)

// TODO: AddGroups SetDataSource SetBackend SetCron SetToken SetRetry

func Start(ctx context.Context, path string) {
Init(path)
cron.Start(ctx)
Expand All @@ -28,3 +26,27 @@ func Init(path string) {
graphql.Init()
rest.Init()
}

func AddGroups(groups ...config.Group) {
config.GlobalConfig.Groups = append(config.GlobalConfig.Groups, groups...)
}

func SetDataSource(ds config.DataSource) {
config.GlobalConfig.DataSource = ds
}

func SetBackend(be config.Backend) {
config.GlobalConfig.Backend = be
}

func SetCron(spec string) {
config.GlobalConfig.Backend.Cron = spec
}

func SetToken(token string) {
config.GlobalConfig.Backend.Token = token
}

func SetRetry(times int) {
config.GlobalConfig.Backend.Retry = times
}

0 comments on commit 70490fa

Please sign in to comment.