winsvc

package
v0.0.0-...-2e7d10b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2021 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWinsvcDriver

func NewWinsvcDriver(logger hclog.Logger) drivers.DriverPlugin

Types

type Config

type Config struct {
}

Config is the driver configuration set by the SetConfig RPC call

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func (*Driver) Capabilities

func (d *Driver) Capabilities() (*drivers.Capabilities, error)

func (*Driver) ConfigSchema

func (d *Driver) ConfigSchema() (*hclspec.Spec, error)

func (*Driver) DestroyTask

func (d *Driver) DestroyTask(taskID string, force bool) error

func (*Driver) ExecTask

func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)

func (*Driver) Fingerprint

func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

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) SetConfig

func (d *Driver) SetConfig(cfg *base.Config) error

func (*Driver) Shutdown

func (d *Driver) Shutdown(ctx context.Context) error

func (*Driver) SignalTask

func (d *Driver) SignalTask(taskID string, signal string) error

func (*Driver) StartTask

func (*Driver) StopTask

func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error

func (*Driver) TaskConfigSchema

func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)

func (*Driver) TaskEvents

func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

func (*Driver) TaskStats

func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)

func (*Driver) WaitTask

func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

type ServiceClient

type ServiceClient struct {
	// contains filtered or unexported fields
}

func (ServiceClient) CreateService

func (c ServiceClient) CreateService(name string, executable string, username string, password string, args []string) error

func (ServiceClient) GetServiceStats

func (c ServiceClient) GetServiceStats(name string) (*wmiProcessStats, error)

func (ServiceClient) InspectService

func (c ServiceClient) InspectService(name string) (*Win32Service, error)

func (ServiceClient) IsServiceRunning

func (c ServiceClient) IsServiceRunning(name string) (bool, error)

func (ServiceClient) KillService

func (c ServiceClient) KillService(name string) error

func (ServiceClient) RemoveService

func (c ServiceClient) RemoveService(name string) error

func (ServiceClient) StartService

func (c ServiceClient) StartService(name string) error

func (ServiceClient) StopService

func (c ServiceClient) StopService(name string) error

type ServiceClientInterface

type ServiceClientInterface interface {
	CreateService(name string, executable string, username string, password string, args []string) error
	RemoveService(name string) error
	StartService(name string) error
	StopService(name string) error
	KillService(name string) error
	InspectService(name string) (*Win32Service, error)
	IsServiceRunning(name string) (bool, error)
	GetServiceStats(name string) (*wmiProcessStats, error)
}

type TaskConfig

type TaskConfig struct {
	// This struct is the decoded version of the schema defined in the
	// taskConfigSpec variable above. It's used to convert the string
	// configuration for the task into Go contructs.
	Executable string   `codec:"executable"`
	Args       []string `codec:"args"`
	Username   string   `codec:"username"`
	Password   string   `codec:"password"`
}

type TaskState

type TaskState struct {
	TaskConfig  *drivers.TaskConfig
	ServiceName string
	StartedAt   time.Time
}

TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the task state and handler during recovery.

type Win32Service

type Win32Service struct {
	ExitCode  uint16
	Name      string
	ProcessId uint16
	StartMode string
	State     string
	Status    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL