goexec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteAuxiliaryMethod

func ExecuteAuxiliaryMethod(ctx context.Context, module AuxiliaryMethod) (err error)

func ExecuteCleanAuxiliaryMethod

func ExecuteCleanAuxiliaryMethod(ctx context.Context, module CleanAuxiliaryMethod) (err error)

func ExecuteCleanMethod

func ExecuteCleanMethod(ctx context.Context, module CleanExecutionMethod, execIO *ExecutionIO) (err error)

func ExecuteMethod

func ExecuteMethod(ctx context.Context, module ExecutionMethod, execIO *ExecutionIO) (err error)

Types

type AuthOptions

type AuthOptions struct {
	Target     *adauth.Target
	Credential *adauth.Credential
}

AuthOptions holds Windows / Active Directory authentication parameters

type AuxiliaryMethod

type AuxiliaryMethod interface {
	Method
	Call(ctx context.Context) error
}

type Clean

type Clean interface {
	Clean(ctx context.Context) error
}

type CleanAuxiliaryMethod

type CleanAuxiliaryMethod interface {
	AuxiliaryMethod
	Clean
}

type CleanExecutionMethod

type CleanExecutionMethod interface {
	ExecutionMethod
	Clean
}

type CleanMethod

type CleanMethod interface {
	Method
	Clean
}

type Cleaner

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

func (*Cleaner) AddCleaners

func (c *Cleaner) AddCleaners(workers ...func(ctx context.Context) error)

func (*Cleaner) Clean

func (c *Cleaner) Clean(ctx context.Context) (err error)

type Client

type Client interface {

	// Connect establishes a connection to the remote server
	Connect(ctx context.Context) error

	// Close terminates the active connection and frees allocated resources
	Close(ctx context.Context) error
}

Client represents an application layer network client

type ClientOptions

type ClientOptions struct {

	// Proxy specifies the URI of the proxy server to route client requests through
	Proxy string `json:"proxy,omitempty" yaml:"proxy,omitempty"`

	// Host specifies the hostname or IP address that the client should connect to
	Host string `json:"host" yaml:"host"`

	// Port specifies the network port on Host that the client will connect to
	Port uint16 `json:"port" yaml:"port"`
}

ClientOptions represents configuration options for a Client

type ContextOption added in v0.2.1

type ContextOption string
const (
	ContextOptionOutputTimeout      ContextOption = "output.timeout"
	ContextOptionOutputPollInterval ContextOption = "output.pollInterval"
)

type Dialer

type Dialer interface {

	// Dial establishes a network connection (net.Conn) using the provided parameters
	Dial(network string, address string) (connection net.Conn, err error)
}

Dialer outlines a basic implementation for establishing network connections

func ParseProxyURI

func ParseProxyURI(uri string) (dialer Dialer, err error)

ParseProxyURI parses the provided proxy URI spec to a Dialer

type ExecutionIO

type ExecutionIO struct {
	Cleaner

	Input  *ExecutionInput
	Output *ExecutionOutput
}

func (*ExecutionIO) Clean

func (execIO *ExecutionIO) Clean(ctx context.Context) (err error)

func (*ExecutionIO) CommandLine

func (execIO *ExecutionIO) CommandLine() (cmd []string)

func (*ExecutionIO) GetOutput

func (execIO *ExecutionIO) GetOutput(ctx context.Context) (err error)

func (*ExecutionIO) String

func (execIO *ExecutionIO) String() (str string)

type ExecutionInput

type ExecutionInput struct {
	StageFile      io.ReadCloser
	Executable     string
	ExecutablePath string
	Arguments      string
	Command        string
}

func (*ExecutionInput) CommandLine

func (i *ExecutionInput) CommandLine() (cmd []string)

func (*ExecutionInput) Reader

func (i *ExecutionInput) Reader() (reader io.Reader)

func (*ExecutionInput) String

func (i *ExecutionInput) String() string

type ExecutionMethod

type ExecutionMethod interface {
	Method
	Execute(ctx context.Context, io *ExecutionIO) error
}

type ExecutionOutput

type ExecutionOutput struct {
	NoDelete   bool
	RemotePath string
	Timeout    time.Duration
	Provider   OutputProvider
	Writer     io.WriteCloser
}

type Executor

type Executor struct {
}

Executor is a structure shared by all execution methods

type Method

type Method interface {
	Connect(ctx context.Context) error
	Init(ctx context.Context) error
}

type OutputProvider

type OutputProvider interface {
	GetOutput(ctx context.Context, writer io.Writer) (err error)
	Clean(ctx context.Context) (err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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