services

package
v0.0.0-...-f6c6bc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GenerateJWTToken

func GenerateJWTToken(user *models.User) (string, time.Time, error)

func NewMongoConnection

func NewMongoConnection(tc *models.TaskerConfig) (*mongo.Client, error)

NewMongoConnection - creates a MongoConnection instance

Types

type GithubAPIService

type GithubAPIService struct {
	Client *github.Client
}

func NewGithubAPIService

func NewGithubAPIService(accessToken string) *GithubAPIService

func (*GithubAPIService) DownloadTaggedAssets

func (g *GithubAPIService) DownloadTaggedAssets()

func (*GithubAPIService) GetUser

func (g *GithubAPIService) GetUser() (*github.User, error)

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 (*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) Delete

func (m *MongoService) Delete(taskID string) error

Delete -

func (*MongoService) FindOne

func (m *MongoService) FindOne(taskID string) (*models.Task, error)

FindOne -

func (*MongoService) List

func (m *MongoService) List() ([]*models.Task, error)

List - List operation for task service

func (*MongoService) Update

func (m *MongoService) Update(updatedTask *models.Task) error

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

type TaskService struct {
	DB        *mongo.Client
	Scheduler *cron.Cron
}

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) Delete

func (t *TaskService) Delete(id string) error

Delete -

func (*TaskService) Disable

func (t *TaskService) Disable(id string) error

func (*TaskService) Find

func (t *TaskService) Find(id string) (*models.Task, error)

func (*TaskService) List

func (t *TaskService) List() ([]*models.Task, 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

func (u *UserService) CreateUser(newUser *models.User) (*models.User, error)

func (*UserService) FindUser

func (u *UserService) FindUser(username string) (*models.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL