Documentation ¶
Index ¶
- Variables
- func GenerateJWTToken(user *models.User) (string, time.Time, error)
- func NewMongoConnection(tc *models.TaskerConfig) (*mongo.Client, error)
- type GithubAPIService
- type GithubAuthService
- type MongoService
- func (m *MongoService) Create(newTask *models.NewInputTask) (*models.Task, error)
- func (m *MongoService) Delete(taskID string) error
- func (m *MongoService) FindOne(taskID string) (*models.Task, error)
- func (m *MongoService) List() ([]*models.Task, error)
- func (m *MongoService) Update(updatedTask *models.Task) error
- type NewInputTask
- type RunnerFunc
- type SettingService
- func (s *SettingService) CreatePluginSetting(input *models.PluginSetting) (*models.PluginSetting, error)
- func (s *SettingService) FindPluginSettingByRepo(repoName string) (*models.PluginSetting, error)
- func (s *SettingService) ListPluginSettings(filters map[string]interface{}) ([]*models.PluginSetting, error)
- func (s *SettingService) ToggleActiveSettingPluginRepo(toggleInput *models.ToggleActiveSetting) error
- type TaskSearchOptions
- type TaskService
- func (t *TaskService) Create(i *models.NewInputTask) (*models.Task, error)
- func (t *TaskService) Delete(id string) error
- func (t *TaskService) Disable(id string) error
- func (t *TaskService) Find(id string) (*models.Task, error)
- func (t *TaskService) List() ([]*models.Task, error)
- func (t *TaskService) Runner(m *MongoService, task *models.Task) RunnerFunc
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var ServiceSet = wire.NewSet(NewGithubAuthService, NewUserService, NewSettingService, NewTaskService, NewMongoService, NewMongoConnection)
Functions ¶
func NewMongoConnection ¶
func NewMongoConnection(tc *models.TaskerConfig) (*mongo.Client, error)
NewMongoConnection - creates a MongoConnection instance
Types ¶
type GithubAPIService ¶
func NewGithubAPIService ¶
func NewGithubAPIService(accessToken string) *GithubAPIService
func (*GithubAPIService) DownloadTaggedAssets ¶
func (g *GithubAPIService) DownloadTaggedAssets()
type GithubAuthService ¶
type GithubAuthService struct { Client *resty.Client Req *resty.Request LoginTokenURL string APIURL string }
func NewGithubAuthService ¶
func NewGithubAuthService() *GithubAuthService
NewService - Creates an instance of UserService
func (*GithubAuthService) FetchClientID ¶
func (g *GithubAuthService) FetchClientID(scope utils.GithubScopeType) *models.GithubClientResponse
func (*GithubAuthService) GetAccessToken ¶
func (g *GithubAuthService) GetAccessToken(code string) (*models.GithubAccessTokenResponse, error)
type MongoService ¶
type MongoService struct {
Collection *mongo.Collection
}
MongoService - a service to interact with a task
func NewMongoService ¶
func NewMongoService(db *mongo.Client) *MongoService
NewMongoService - initializes task service
func (*MongoService) Create ¶
func (m *MongoService) Create(newTask *models.NewInputTask) (*models.Task, error)
Create - create operation for task service
func (*MongoService) FindOne ¶
func (m *MongoService) FindOne(taskID string) (*models.Task, error)
FindOne -
type NewInputTask ¶
type NewInputTask struct { Name string `json:"name"` Args map[string]interface{} `json:"args"` Schedule string `json:"schedule"` IsRepeatable bool `json:"isRepeatable"` Executor string `json:"executor"` EntryID cron.EntryID `json:"entryId"` }
NewInputTask - object to store all parameters for creating a new task
type RunnerFunc ¶
type RunnerFunc func()
type SettingService ¶
type SettingService struct {
Collection *mongo.Collection
}
SettingService - a service to interact with the settings of tasker
func NewSettingService ¶
func NewSettingService(db *mongo.Client) *SettingService
NewSettingService - initializes task service
func (*SettingService) CreatePluginSetting ¶
func (s *SettingService) CreatePluginSetting(input *models.PluginSetting) (*models.PluginSetting, error)
func (*SettingService) FindPluginSettingByRepo ¶
func (s *SettingService) FindPluginSettingByRepo(repoName string) (*models.PluginSetting, error)
func (*SettingService) ListPluginSettings ¶
func (s *SettingService) ListPluginSettings(filters map[string]interface{}) ([]*models.PluginSetting, error)
func (*SettingService) ToggleActiveSettingPluginRepo ¶
func (s *SettingService) ToggleActiveSettingPluginRepo(toggleInput *models.ToggleActiveSetting) error
type TaskSearchOptions ¶
type TaskSearchOptions struct {
Enabled bool `json:"enabled"`
}
TaskSearchOptions -
type TaskService ¶
TaskService - This is a wrapper around Tasker object
func NewTaskService ¶
func NewTaskService(db *mongo.Client, scheduler *cron.Cron) *TaskService
func (*TaskService) Create ¶
func (t *TaskService) Create(i *models.NewInputTask) (*models.Task, error)
func (*TaskService) Disable ¶
func (t *TaskService) Disable(id string) error
func (*TaskService) Runner ¶
func (t *TaskService) Runner(m *MongoService, task *models.Task) RunnerFunc
type UserService ¶
type UserService struct {
Collection *mongo.Collection
}
MongoService - a service to interact with a task
func NewUserService ¶
func NewUserService(db *mongo.Client) *UserService
NewUserService - initializes task service
func (*UserService) CreateUser ¶
Click to show internal directories.
Click to hide internal directories.