services

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TASK_CREATED   = "TASK_CREATED"
	TASK_COMPLETED = "TASK_COMPLETED"
	TASK_FAILED    = "TASK_FAILED"
)

Variables

This section is empty.

Functions

func CancelTask added in v0.3.0

func CancelTask(taskId uint64) error

func CreateTaskInDB added in v0.3.0

func CreateTaskInDB(data NewTask) (*models.Task, error)

func CreateTasksInDBFromJSON added in v0.3.0

func CreateTasksInDBFromJSON(data [][]NewTask) [][]models.Task

func GetPluginsApiResources added in v0.3.0

func GetPluginsApiResources() (map[string]map[string]map[string]core.ApiResourceHandler, error)

* return value

{
	"jira": {
		"sources": {
			"POST": *ApiResourceHandler
		}
	}
}

func GetTasks

func GetTasks(status string) ([]models.Task, error)

func RunAllTasks added in v0.3.0

func RunAllTasks(data [][]NewTask, tasks [][]models.Task) (err error)

func RunTask added in v0.3.0

func RunTask(task models.Task, data NewTask, taskComplete chan bool) (models.Task, error)

Types

type NewTask

type NewTask struct {
	// Plugin name
	Plugin string `json:"plugin" binding:"required"`
	// Options for the plugin task to be triggered
	Options map[string]interface{} `json:"options" binding:"required"`
}

type NotificationService added in v0.3.0

type NotificationService struct {
	EndPoint string
	Secret   string
}

func NewNotificationService added in v0.3.0

func NewNotificationService(endpoint, secret string) *NotificationService

func (*NotificationService) TaskSuccess added in v0.3.0

func (n *NotificationService) TaskSuccess(params TaskSuccessNotification) error

type TaskSuccessNotification added in v0.3.0

type TaskSuccessNotification struct {
	TaskID     uint64
	PluginName string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Jump to

Keyboard shortcuts

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