os

package
v0.0.0-...-1fa5987 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDaemonController

func NewDaemonController(svc api.Service) sdk.AComponentController

func NewFileController

func NewFileController(svc api.Service) *sdk.ResourceComponentController

func NewProcessController

func NewProcessController(svc api.Service) *sdk.ResourceComponentController

Types

type DaemonController

type DaemonController struct {
	sdk.PureComponentController[DaemonModel]
}

func (*DaemonController) RenderComponent

func (ctrl *DaemonController) RenderComponent(ctx context.Context, cfg *sdk.ComponentConfig, m *DaemonModel) ([]sdk.RenderedComponent, error)

type DaemonModel

type DaemonModel struct {
	DaemonSpec
}

type DaemonSpec

type DaemonSpec struct {
	Program     string            `json:"program"`
	Arguments   []string          `json:"arguments,omitempty"`
	Directory   string            `json:"directory,omitempty"`
	Environment map[string]string `json:"environment,omitempty"`
}

type FileController

type FileController struct{}

func (*FileController) CreateResource

func (ctrl *FileController) CreateResource(ctx context.Context, cfg *sdk.ResourceConfig, m *FileModel) error

func (*FileController) DeleteResource

func (ctrl *FileController) DeleteResource(ctx context.Context, cfg *sdk.ResourceConfig, m *FileModel) error

func (*FileController) IdentifyResource

func (ctrl *FileController) IdentifyResource(ctx context.Context, cfg *sdk.ResourceConfig, m *FileModel) (string, error)

func (*FileController) ReadResource

func (ctrl *FileController) ReadResource(ctx context.Context, cfg *sdk.ResourceConfig, m *FileModel) error

func (*FileController) ShutdownResource

func (ctrl *FileController) ShutdownResource(ctx context.Context, cfg *sdk.ResourceConfig, m *FileModel) error

func (*FileController) UpdateResource

func (ctrl *FileController) UpdateResource(ctx context.Context, cfg *sdk.ResourceConfig, prev *FileModel, next *FileModel) error

type FileModel

type FileModel struct {
	FileSpec
	FileState
}

type FileSpec

type FileSpec struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

type FileState

type FileState struct {
	Size     *string          `json:"size,omitempty"` // String for int64 support.
	Modified *scalars.Instant `json:"modified,omitempty"`
}

type ProcessController

type ProcessController struct {
	sdk.ResourceController[ProcessModel]
}

func (*ProcessController) Create

func (*ProcessController) Delete

func (*ProcessController) IdentifyResource

func (ctrl *ProcessController) IdentifyResource(ctx context.Context, cfg *sdk.ResourceConfig, m *ProcessModel) (string, error)

func (*ProcessController) ReadResource

func (ctrl *ProcessController) ReadResource(ctx context.Context, cfg *sdk.ResourceConfig, m *ProcessModel) error

func (*ProcessController) Shutdown

func (ctrl *ProcessController) Shutdown(ctx context.Context, cfg *sdk.ResourceConfig, m *ProcessModel) error

type ProcessModel

type ProcessModel struct {
	ProcessSpec
	ProcessState
}

type ProcessSpec

type ProcessSpec struct {
	Program     string            `json:"program,omitempty"`
	Arguments   []string          `json:"arguments,omitempty"`
	Directory   string            `json:"directory,omitempty"`
	Environment map[string]string `json:"environment,omitempty"`
}

type ProcessState

type ProcessState struct {
	ProgramPath string `json:"programPath,omitempty"`
	Pid         *int   `json:"pid,omitempty"`
}

Jump to

Keyboard shortcuts

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