Documentation ¶
Index ¶
- Variables
- type Cmd
- type CmdState
- type DB
- type Priority
- type Qmd
- func (qmd *Qmd) Close()
- func (qmd *Qmd) ClosingResponder(h http.Handler) http.Handler
- func (qmd *Qmd) Cmd(from *exec.Cmd) (*Cmd, error)
- func (qmd *Qmd) Dequeue() (*disque.Job, error)
- func (qmd *Qmd) Enqueue(data string, priority string) (*disque.Job, error)
- func (qmd *Qmd) GetAsyncResponse(req *api.ScriptsRequest, ID string) ([]byte, error)
- func (qmd *Qmd) GetResponse(ID string) ([]byte, error)
- func (qmd *Qmd) GetScript(file string) (string, error)
- func (qmd *Qmd) ListenQueue()
- func (qmd *Qmd) PostResponseCallback(req *api.ScriptsRequest, ID string) error
- func (qmd *Qmd) StartWorkers()
- func (qmd *Qmd) WatchScripts()
- type Scripts
- type SlackNotifier
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct { *exec.Cmd `json:"cmd"` JobID string State CmdState StartTime time.Time EndTime time.Time Duration time.Duration StatusCode int CallbackURL string Err error Priority Priority CmdOut bytes.Buffer QmdOut bytes.Buffer QmdOutFile string StoreDir string ExtraWorkDirFiles map[string]string // Started channel block until the cmd is started. Started chan struct{} // Finished channel block until the cmd is finished/killed/invalidated. Finished chan struct{} // WaitOnce guards the Wait() logic, so it can be called multiple times. WaitOnce sync.Once // StartOnce guards the Start() logic, so it can be called multiple times. StartOnce sync.Once }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) SaveResponse ¶
func (db *DB) SaveResponse(resp *api.ScriptsResponse) error
type Qmd ¶
type Qmd struct { Config *config.Config DB *DB Queue *disque.Pool Scripts Scripts Workers chan Worker Slack *SlackNotifier Closing bool ClosingListenQueue chan struct{} WaitListenQueue sync.WaitGroup ClosingWorkers chan struct{} WaitWorkers sync.WaitGroup }
func (*Qmd) GetAsyncResponse ¶
func (*Qmd) ListenQueue ¶
func (qmd *Qmd) ListenQueue()
func (*Qmd) PostResponseCallback ¶
func (qmd *Qmd) PostResponseCallback(req *api.ScriptsRequest, ID string) error
func (*Qmd) StartWorkers ¶
func (qmd *Qmd) StartWorkers()
type Scripts ¶
type SlackNotifier ¶
func (*SlackNotifier) Notify ¶
func (s *SlackNotifier) Notify(msg string) error
Click to show internal directories.
Click to hide internal directories.