{"modulePath":"github.com/Coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package engine\n\n## Variables\n\n```go\nvar (\n\t// name of the build agent container.\n\tDefaultAgent = \"drone/drone-exec:latest\"\n\n\t// default name of the build agent executable\n\tDefaultEntrypoint = []string{\"/bin/drone-exec\"}\n\n\t// default argument to invoke build steps\n\tDefaultBuildArgs = []string{\"--pull\", \"--cache\", \"--clone\", \"--build\", \"--deploy\"}\n\n\t// default argument to invoke build steps\n\tDefaultPullRequestArgs = []string{\"--pull\", \"--cache\", \"--clone\", \"--build\"}\n\n\t// default arguments to invoke notify steps\n\tDefaultNotifyArgs = []string{\"--pull\", \"--notify\"}\n)\n```\n\n## Functions\n\n```go\nfunc ToContext(c Setter, engine Engine)\n```\nToContext adds the Engine to this context if it supports the Setter interface.\n\n## Types\n\n```go\ntype Engine interface {\n\tSchedule(context.Context, *Task)\n\tCancel(int64, int64, *model.Node) error\n\tStream(int64, int64, *model.Node) (io.ReadCloser, error)\n\tDeallocate(*model.Node)\n\tAllocate(*model.Node) error\n\tSubscribe(chan *Event)\n\tUnsubscribe(chan *Event)\n}\n```\n\n```go\nfunc FromContext(c context.Context) Engine\n```\nFromContext returns the Engine associated with this context.\n\n```go\nfunc Load(s store.Store) Engine\n```\nLoad creates a new build engine, loaded with registered nodes from the database. The registered nodes are added to the pool of nodes to immediately start accepting workloads.\n\n```go\ntype Event struct {\n\tName string\n\tMsg  []byte\n}\n```\n\n```go\ntype Setter interface {\n\tSet(string, interface{})\n}\n```\nSetter defines a context that enables setting values.\n\n```go\ntype Task struct {\n\tUser      *model.User   `json:\"-\"`\n\tRepo      *model.Repo   `json:\"repo\"`\n\tBuild     *model.Build  `json:\"build\"`\n\tBuildPrev *model.Build  `json:\"build_last\"`\n\tJobs      []*model.Job  `json:\"-\"`\n\tJob       *model.Job    `json:\"job\"`\n\tKeys      *model.Key    `json:\"keys\"`\n\tNetrc     *model.Netrc  `json:\"netrc\"`\n\tConfig    string        `json:\"config\"`\n\tSecret    string        `json:\"secret\"`\n\tSystem    *model.System `json:\"system\"`\n}\n```\n\n","path":"github.com/Coding/drone/engine","name":"engine","synopsis":"","isRedistributable":true}
