agent

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownOperation = errors.New("unknown operation")

Functions

This section is empty.

Types

type CompoundOperation

type CompoundOperation struct {
	Operations []Operation
}

func (*CompoundOperation) Run

func (c *CompoundOperation) Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)

type Config

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

func ParseConfig

func ParseConfig(input string) (*Config, error)

func ParseConfigFile

func ParseConfigFile(path string) (*Config, error)

func (*Config) Action

func (c *Config) Action(group, id string, hctx *hcl.EvalContext) (Operation, error)

func (*Config) Groups

func (c *Config) Groups() []string

func (*Config) IsAvailable

func (c *Config) IsAvailable(group, id string) (bool, error)

type DockerOptions

type DockerOptions struct {
	Image string `hcl:"image"`
}

type Executor

type Executor struct {
	Log    hclog.Logger
	Config *Config
}

func (*Executor) Execute

func (*Executor) IsAvailable

func (e *Executor) IsAvailable(opInfo *models.HashicorpCloudWaypointAgentOperation) (bool, error)

type HTTPOperation

type HTTPOperation struct {
	URL string
}

func (*HTTPOperation) Run

func (h *HTTPOperation) Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)

type NoopWrapper

type NoopWrapper struct {
	Operation Operation
}

func (*NoopWrapper) Run

func (n *NoopWrapper) Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)

type Operation

type Operation interface {
	Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)
}

func NoopOperations

func NoopOperations(o Operation) Operation

type OperationStatus

type OperationStatus struct {
	Status string
	Code   int
}

type ShellOperation

type ShellOperation struct {
	Arguments     []string
	Environment   map[string]string
	DockerOptions *DockerOptions
}

func (*ShellOperation) Run

func (s *ShellOperation) Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)

type StatusOperation

type StatusOperation struct {
	Message string
	Values  map[string]string
	Status  string
	// contains filtered or unexported fields
}

func (*StatusOperation) Run

func (s *StatusOperation) Run(ctx context.Context, log hclog.Logger) (OperationStatus, error)

Jump to

Keyboard shortcuts

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