Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteTagFromTask(taskId, name string) error
- func InsertTask(t *task.Task, name string, data map[string]interface{}) error
- func SetTagForTask(taskId, name, tag string) error
- type CommitInfo
- type TagContainer
- type TaskForVersionId
- type TaskInfo
- type TaskJSON
- func GetCommit(projectId, revision, variant, taskName, name string) (TaskJSON, error)
- func GetTagsForTask(project, buildVariant, taskName, name string) ([]TaskJSON, error)
- func GetTaskById(taskId, name string) (TaskJSON, error)
- func GetTaskByName(version, buildId, taskName, name string) (TaskJSON, error)
- func GetTaskForVariant(version, variantId, taskName, name string) (TaskJSON, error)
- func GetTaskHistory(t *task.Task, name string) ([]TaskJSON, error)
- func GetTaskJSONByTag(projectId, tag, variant, taskName, name string) (*TaskJSON, error)
- func GetTasksForVersion(versionId, name string) ([]TaskJSON, error)
- type TaskJSONGetCommand
- type TaskJSONHistoryCommand
- func (jgc *TaskJSONHistoryCommand) Execute(log plugin.Logger, com plugin.PluginCommunicator, conf *model.TaskConfig, ...) error
- func (jgc *TaskJSONHistoryCommand) Name() string
- func (jgc *TaskJSONHistoryCommand) ParseParams(params map[string]interface{}) error
- func (jgc *TaskJSONHistoryCommand) Plugin() string
- type TaskJSONPlugin
- func (jsp *TaskJSONPlugin) Configure(map[string]interface{}) error
- func (jsp *TaskJSONPlugin) GetAPIHandler() http.Handler
- func (jsp *TaskJSONPlugin) GetPanelConfig() (*plugin.PanelConfig, error)
- func (hwp *TaskJSONPlugin) GetUIHandler() http.Handler
- func (jsp *TaskJSONPlugin) Name() string
- func (jsp *TaskJSONPlugin) NewCommand(cmdName string) (plugin.Command, error)
- type TaskJSONSendCommand
- func (tjsc *TaskJSONSendCommand) Execute(log plugin.Logger, com plugin.PluginCommunicator, conf *model.TaskConfig, ...) error
- func (tjsc *TaskJSONSendCommand) Name() string
- func (tjsc *TaskJSONSendCommand) ParseParams(params map[string]interface{}) error
- func (tjsc *TaskJSONSendCommand) Plugin() string
- type TasksForVersion
- type VersionData
Constants ¶
const ( TaskJSONPluginName = "json" TaskJSONSend = "send" TaskJSONGet = "get" TaskJSONGetHistory = "get_history" TaskJSONHistory = "history" )
Variables ¶
var ( // BSON fields for the TaskJSON struct NameKey = bsonutil.MustHaveTag(TaskJSON{}, "Name") TaskNameKey = bsonutil.MustHaveTag(TaskJSON{}, "TaskName") ProjectIdKey = bsonutil.MustHaveTag(TaskJSON{}, "ProjectId") TaskIdKey = bsonutil.MustHaveTag(TaskJSON{}, "TaskId") BuildIdKey = bsonutil.MustHaveTag(TaskJSON{}, "BuildId") VariantKey = bsonutil.MustHaveTag(TaskJSON{}, "Variant") VersionIdKey = bsonutil.MustHaveTag(TaskJSON{}, "VersionId") CreateTimeKey = bsonutil.MustHaveTag(TaskJSON{}, "CreateTime") IsPatchKey = bsonutil.MustHaveTag(TaskJSON{}, "IsPatch") RevisionOrderNumberKey = bsonutil.MustHaveTag(TaskJSON{}, "RevisionOrderNumber") RevisionKey = bsonutil.MustHaveTag(TaskJSON{}, "Revision") DataKey = bsonutil.MustHaveTag(TaskJSON{}, "Data") TagKey = bsonutil.MustHaveTag(TaskJSON{}, "Tag") )
Functions ¶
func DeleteTagFromTask ¶
func InsertTask ¶
InsertTask creates a TaskJSON document in the plugin's collection.
func SetTagForTask ¶
Types ¶
type CommitInfo ¶
type CommitInfo struct { Author string `json:"author"` Message string `json:"message"` CreateTime time.Time `json:"create_time"` Revision string `json:"revision"` VersionId string `json:"version_id"` }
CommitInfo represents the information about the commit associated with the version of a given project. This is displayed at the top of each header for each project.
type TagContainer ¶
type TagContainer struct {
Tag string `bson:"_id" json:"tag"`
}
func GetTags ¶
func GetTags(taskId string) ([]TagContainer, error)
GetTags finds TaskJSONs that have tags in the project associated with a given task.
type TaskForVersionId ¶
TaskForVersionId contains the id information about the group of tasks including the version id and the revision order number.
type TaskInfo ¶
type TaskInfo struct { TaskId string `bson:"t_id" json:"task_id"` TaskName string `bson:"tn" json:"task_name"` Variant string `bson:"var" json:"variant"` Data interface{} `bson:"d" json:"data"` }
TaskInfo contains the relevant TaskJSON information the tasks associated with a version.
type TaskJSON ¶
type TaskJSON struct { Name string `bson:"name" json:"name"` TaskName string `bson:"task_name" json:"task_name"` ProjectId string `bson:"project_id" json:"project_id"` TaskId string `bson:"task_id" json:"task_id"` BuildId string `bson:"build_id" json:"build_id"` Variant string `bson:"variant" json:"variant"` VersionId string `bson:"version_id" json:"version_id"` CreateTime time.Time `bson:"create_time" json:"create_time"` IsPatch bool `bson:"is_patch" json:"is_patch"` RevisionOrderNumber int `bson:"order" json:"order"` Revision string `bson:"revision" json:"revision"` Data map[string]interface{} `bson:"data" json:"data"` Tag string `bson:"tag" json:"tag"` }
func GetCommit ¶
GetCommit gets the task data associated with a particular task by using the commit hash to find the data.
func GetTagsForTask ¶
GetTagsForTask gets all of the tasks with tags for the given task name and build variant.
func GetTaskById ¶
GetTaskById fetches a JSONTask with the corresponding task id.
func GetTaskByName ¶
GetTaskByName finds a taskdata document by using the name of the task and other identifying information.
func GetTaskForVariant ¶
GetTaskForVariant finds a task by name and variant and finds the document in the json collection associated with that task's id.
func GetTaskJSONByTag ¶
GetTaskJSONByTag finds a TaskJSON by a tag
func GetTasksForVersion ¶
GetTasksForVersion sends back the list of TaskJSON documents associated with a version id.
type TaskJSONGetCommand ¶
type TaskJSONGetCommand struct { File string `mapstructure:"file" plugin:"expand"` DataName string `mapstructure:"name" plugin:"expand"` TaskName string `mapstructure:"task" plugin:"expand"` Variant string `mapstructure:"variant" plugin:"expand"` }
func (*TaskJSONGetCommand) Execute ¶
func (jgc *TaskJSONGetCommand) Execute(log plugin.Logger, com plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error
func (*TaskJSONGetCommand) Name ¶
func (jgc *TaskJSONGetCommand) Name() string
func (*TaskJSONGetCommand) ParseParams ¶
func (jgc *TaskJSONGetCommand) ParseParams(params map[string]interface{}) error
func (*TaskJSONGetCommand) Plugin ¶
func (jgc *TaskJSONGetCommand) Plugin() string
type TaskJSONHistoryCommand ¶
type TaskJSONHistoryCommand struct { Tags bool `mapstructure:"tags"` File string `mapstructure:"file" plugin:"expand"` DataName string `mapstructure:"name" plugin:"expand"` TaskName string `mapstructure:"task" plugin:"expand"` }
func (*TaskJSONHistoryCommand) Execute ¶
func (jgc *TaskJSONHistoryCommand) Execute(log plugin.Logger, com plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error
func (*TaskJSONHistoryCommand) Name ¶
func (jgc *TaskJSONHistoryCommand) Name() string
func (*TaskJSONHistoryCommand) ParseParams ¶
func (jgc *TaskJSONHistoryCommand) ParseParams(params map[string]interface{}) error
func (*TaskJSONHistoryCommand) Plugin ¶
func (jgc *TaskJSONHistoryCommand) Plugin() string
type TaskJSONPlugin ¶
type TaskJSONPlugin struct{}
TaskJSONPlugin handles thet
func (*TaskJSONPlugin) Configure ¶
func (jsp *TaskJSONPlugin) Configure(map[string]interface{}) error
func (*TaskJSONPlugin) GetAPIHandler ¶
func (jsp *TaskJSONPlugin) GetAPIHandler() http.Handler
GetRoutes returns an API route for serving patch data.
func (*TaskJSONPlugin) GetPanelConfig ¶
func (jsp *TaskJSONPlugin) GetPanelConfig() (*plugin.PanelConfig, error)
GetPanelConfig is required to fulfill the Plugin interface. This plugin does not have any UI hooks.
func (*TaskJSONPlugin) GetUIHandler ¶
func (hwp *TaskJSONPlugin) GetUIHandler() http.Handler
func (*TaskJSONPlugin) Name ¶
func (jsp *TaskJSONPlugin) Name() string
Name implements Plugin Interface.
func (*TaskJSONPlugin) NewCommand ¶
func (jsp *TaskJSONPlugin) NewCommand(cmdName string) (plugin.Command, error)
NewCommand returns requested commands by name. Fulfills the Plugin interface.
type TaskJSONSendCommand ¶
type TaskJSONSendCommand struct { File string `mapstructure:"file" plugin:"expand"` DataName string `mapstructure:"name" plugin:"expand"` }
func (*TaskJSONSendCommand) Execute ¶
func (tjsc *TaskJSONSendCommand) Execute(log plugin.Logger, com plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error
func (*TaskJSONSendCommand) Name ¶
func (tjsc *TaskJSONSendCommand) Name() string
func (*TaskJSONSendCommand) ParseParams ¶
func (tjsc *TaskJSONSendCommand) ParseParams(params map[string]interface{}) error
func (*TaskJSONSendCommand) Plugin ¶
func (tjsc *TaskJSONSendCommand) Plugin() string
type TasksForVersion ¶
type TasksForVersion struct { Id TaskForVersionId `bson:"_id" json:"id"` Tasks []TaskInfo `bson:"t" json:"tasks"` }
TasksForVersion is a list of tasks that are associated with a given version id.
type VersionData ¶
type VersionData struct { JSONTasks []TaskInfo `json:"json_tasks"` Commit CommitInfo `json:"commit_info"` LastRevision bool `json:"last_revision"` }
VersionData includes the TaskInfo, and Commit information for a given version.
func GetTasksForLatestVersion ¶
func GetTasksForLatestVersion(project, name string, skip int) (*VersionData, error)
GetTasksForLatestVersion sends back the TaskJSON data associated with the latest version.