{"modulePath":"github.com/Coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package queue\n\n## Variables\n\n```go\nvar ErrNotFound = errors.New(\"queue item not found\")\n```\nErrNotFound indicates the requested work item does not exist in the queue.\n\n## Functions\n\n```go\nfunc Publish(c context.Context, w *Work) error\n```\nPublish inserts work at the tail of this queue, waiting for space to become available if the queue is full.\n\n```go\nfunc Remove(c context.Context, w *Work) error\n```\nRemove removes the specified work item from this queue, if it is present.\n\n```go\nfunc ToContext(c Setter, q Queue)\n```\nToContext adds the Queue to this context if it supports the Setter interface.\n\n## Types\n\n```go\ntype CloseNotifier interface {\n\t// CloseNotify returns a channel that receives a single value\n\t// when the client connection has gone away.\n\tCloseNotify() \u003c-chan bool\n}\n```\nCloseNotifier defines a datastructure that is capable of notifying a subscriber when its connection is closed.\n\n```go\ntype Queue interface {\n\t// Publish inserts work at the tail of this queue, waiting for\n\t// space to become available if the queue is full.\n\tPublish(*Work) error\n\n\t// Remove removes the specified work item from this queue,\n\t// if it is present.\n\tRemove(*Work) error\n\n\t// PullClose retrieves and removes the head of this queue,\n\t// waiting if necessary until work becomes available.\n\tPull() *Work\n\n\t// PullClose retrieves and removes the head of this queue,\n\t// waiting if necessary until work becomes available. The\n\t// CloseNotifier should be provided to clone the channel\n\t// if the subscribing client terminates its connection.\n\tPullClose(CloseNotifier) *Work\n}\n```\n\n```go\nfunc FromContext(c context.Context) Queue\n```\nFromContext returns the Queue associated with this context.\n\n```go\nfunc New() Queue\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 Work struct {\n\tSigned    bool            `json:\"signed\"`\n\tVerified  bool            `json:\"verified\"`\n\tYaml      string          `json:\"config\"`\n\tYamlEnc   string          `json:\"secret\"`\n\tRepo      *model.Repo     `json:\"repo\"`\n\tBuild     *model.Build    `json:\"build\"`\n\tBuildLast *model.Build    `json:\"build_last\"`\n\tJob       *model.Job      `json:\"job\"`\n\tNetrc     *model.Netrc    `json:\"netrc\"`\n\tKeys      *model.Key      `json:\"keys\"`\n\tSystem    *model.System   `json:\"system\"`\n\tSecrets   []*model.Secret `json:\"secrets\"`\n\tUser      *model.User     `json:\"user\"`\n}\n```\nWork represents an item for work to be processed by a worker.\n\n```go\nfunc Pull(c context.Context) *Work\n```\nPullClose retrieves and removes the head of this queue, waiting if necessary until work becomes available.\n\n```go\nfunc PullClose(c context.Context, cn CloseNotifier) *Work\n```\nPullClose retrieves and removes the head of this queue, waiting if necessary until work becomes available. The CloseNotifier should be provided to clone the channel if the subscribing client terminates its connection.\n\n","path":"github.com/Coding/drone/queue","name":"queue","synopsis":"","isRedistributable":true}
