Documentation ¶
Overview ¶
Package bot wraps managing Swarming bots.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot interface { // Wait waits for the bot process to exit. The return value // on subsequent calls is undefined. Wait() error // Drain signals for the bot to drain. Note that this requires // support from the bot script. This should be handled by Swarming // bots by waiting for the currently running task to finish before // exiting. Drain() error // Terminate terminates the bot with SIGTERM. Swarming bots handle // SIGTERM by aborting the currently running task and exiting. Terminate() error }
Bot is the interface for interacting with a started Swarming bot. Wait must be called to ensure the process is waited for.
type Config ¶
type Config struct { // SwarmingURL is the URL of the Swarming instance. Should be // a full URL without the path, e.g. https://host.example.com SwarmingURL string BotID string // WorkDirectory is the Swarming bot's work directory. // The caller should create this. // The parent directory should be writable to allow creation // of the drain file. WorkDirectory string }
Config is the configuration needed for starting a generic Swarming bot.
type FakeBot ¶
type FakeBot struct { // DrainFunc, if set, is called when the bot is drained. The // default behavior is Stop. DrainFunc func(*FakeBot) error // TerminateFunc, if set, is called when the bot is terminated. // The default behavior is Stop. TerminateFunc func(*FakeBot) error // contains filtered or unexported fields }
FakeBot is a fake implementation of Bot for tests.
Click to show internal directories.
Click to hide internal directories.