Documentation ¶
Index ¶
- type Driver
- func (d *Driver) Capabilities() (*drivers.Capabilities, error)
- func (d *Driver) ConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) DestroyTask(taskID string, force bool) error
- func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
- func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
- func (d *Driver) GetDriverConfig() *DriverConfig
- func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
- func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
- func (d *Driver) ResetDebugJob(job *string) string
- func (d *Driver) SetConfig(c *base.Config) (err error)
- func (d *Driver) SetLogLevel(level string) error
- func (d *Driver) SetSetupApiServerFn(fn func(logger g.LoggerType, driverConfig *DriverConfig) (err error))
- func (d *Driver) SetupNatsServer(logger g.LoggerType) (err error)
- func (d *Driver) Shutdown()
- func (d *Driver) SignalTask(taskID string, signal string) error
- func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
- func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error
- func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)
- func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)
- func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
- type DriverConfig
- type DriverHandle
- type TaskState
- type TaskStoreForApi
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a driver for running images via Java
func NewDriver ¶
func NewDriver(logger g.LoggerType) *Driver
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() (*drivers.Capabilities, error)
func (*Driver) Fingerprint ¶
func (*Driver) GetDriverConfig ¶
func (d *Driver) GetDriverConfig() *DriverConfig
func (*Driver) InspectTask ¶
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
func (*Driver) PluginInfo ¶
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
func (*Driver) RecoverTask ¶
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
func (*Driver) ResetDebugJob ¶
func (*Driver) SetLogLevel ¶
func (*Driver) SetSetupApiServerFn ¶
func (d *Driver) SetSetupApiServerFn(fn func(logger g.LoggerType, driverConfig *DriverConfig) (err error))
func (*Driver) SetupNatsServer ¶
func (d *Driver) SetupNatsServer(logger g.LoggerType) (err error)
func (*Driver) StartTask ¶
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
func (*Driver) StopTask ¶
StopTask will not be called if the task has already exited (e.g. onError).
func (*Driver) TaskEvents ¶
type DriverConfig ¶
type DriverConfig struct { NatsBind string `codec:"nats_bind"` NatsAdvertise string `codec:"nats_advertise"` BigTxMaxJobs int32 `codec:"big_tx_max_jobs"` ApiAddr string `codec:"api_addr"` NomadAddr string `codec:"nomad_addr"` Consul string `codec:"consul"` DataDir string `codec:"data_dir"` StatsCollectionInterval int `codec:"stats_collection_interval"` PublishMetrics bool `codec:"publish_metrics"` LogLevel string `codec:"log_level"` DebugJob string `codec:"debug_job"` LogFile string `codec:"log_file"` UiDir string `codec:"ui_dir"` RsaPrivateKeyPath string `codec:"rsa_private_key_path"` CertFilePath string `codec:"cert_file_path"` KeyFilePath string `codec:"key_file_path"` Memory string `codec:"memory"` }
type DriverHandle ¶
type DriverHandle interface { Run() // Shutdown is used to stop the task. // Do not send ExitResult in Shutdown(). // pause API will call Shutdown and the task should not exit. Shutdown() error // Stats returns aggregated stats of the driver Stats() (*common.TaskStatistics, error) Finish1() error }
type TaskState ¶
type TaskState struct { TaskConfig *drivers.TaskConfig DtleTaskConfig *common.DtleTaskConfig StartedAt time.Time }
TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the taskConfig state and handler during recovery.
type TaskStoreForApi ¶
type TaskStoreForApi struct {
// contains filtered or unexported fields
}
used by http api
var AllocIdTaskNameToTaskHandler *TaskStoreForApi
used by http api
func (*TaskStoreForApi) Delete ¶
func (ts *TaskStoreForApi) Delete(id string)
func (*TaskStoreForApi) Set ¶
func (ts *TaskStoreForApi) Set(allocId, taskName, taskId string, handle *taskHandle)
it can only use allocId and taskName to identify the task from http api but internal operation like deleting task need taskId to identify the task
Click to show internal directories.
Click to hide internal directories.