models

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBType

type DBType string

type GithubAccessTokenResponse

type GithubAccessTokenResponse struct {
	AccessToken      string `json:"access_token"`
	Scope            string `json:"scope"`
	TokenType        string `json:"token_type"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
	ErrorURI         string `json:"error_uri"`
}

GithubAccessTokenResponse -

type GithubClientResponse

type GithubClientResponse struct {
	ClientID string `json:"client_id"`
}

GithubClientResponse -

type ITask

type ITask interface {
	BeforeCreate()
	Create(t *NewInputTask) (interface{}, error)
	FindOne(taskId string) (Task, error)
	List() ([]Task, error)
	ListEnabledTasks(opts *TaskSearchOptions) ([]Task, error)
	Delete(taskId string) error
	Disable(taskId string) error
}

type MongoConnectionURL

type MongoConnectionURL string

type NewInputTask

type NewInputTask struct {
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	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 Payload

type Payload interface {
	Run(args map[string]interface{}) error
}

type PluginSetting

type PluginSetting struct {
	Type            string `json:"type" bson:"type"`
	RepoName        string `json:"repo_name" bson:"repo_name"`
	Active          bool   `json:"active" bson:"active"`
	Description     string `json:"description" bson:"description"`
	BuildFolderName string `json:"build_folder_name" bson:"build_folder_name"`
}

PluginSetting for plugin

func (PluginSetting) BeforeCreate

func (p PluginSetting) BeforeCreate()

TODO validate repo name

type Task

type Task struct {
	TaskID       string                 `json:"taskId" bson:"taskId"`
	EntryID      cron.EntryID           `json:"entryId" bson:"entryId"`
	Name         string                 `json:"name" bson:"name"`
	Description  string                 `json:"description" bson:"description"`
	Executor     string                 `json:"executor" bson:"executor"`
	Schedule     string                 `json:"schedule" bson:"schedule"`
	IsRepeatable bool                   `json:"isRepeatable" bson:"isRepeatable"`
	Enabled      bool                   `json:"enabled" bson:"enabled"`
	Complete     bool                   `json:"complete" bson:"complete"`
	Args         map[string]interface{} `json:"args" bson:"args"`
	CreatedAt    time.Time              `json:"createdAt" bson:"createdAt"`
	UpdatedAt    time.Time              `json:"updatedAt" bson:"updatedAt"`
	DeletedAt    time.Time              `json:"deletedAt" bson:"deletedAt"`
}

func (*Task) BeforeCreate

func (t *Task) BeforeCreate()

BeforeCreate - hook for creation

type TaskSearchOptions

type TaskSearchOptions struct {
	Enabled bool `json:"enabled"`
}

TaskSearchOptions -

type TaskerConfig

type TaskerConfig struct {
	Type               DBType             `required:"true"`
	MongoConnectionURL MongoConnectionURL `required:"true"`
}

type ToggleActiveSetting

type ToggleActiveSetting struct {
	RepoName string `json:"repo_name"`
	Active   bool   `json:"active"`
}

type User

type User struct {
	Email                string `json:"email" bson:"email"`
	Name                 string `json:"name" bson:"name"`
	UserName             string `json:"username" bson:"username"`
	EncryptedAccessToken string `json:"-" bson:"accessToken"`
	AccessToken          string `json:"-" bson:"-"`
	Bio                  string `json:"bio" bson:"bio"`
	GitHubURL            string `json:"githubURL" bson:"githubURL"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

func (*User) GetAccessToken

func (u *User) GetAccessToken() (string, error)

type UserClaims

type UserClaims struct {
	User
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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