agentconn

package
v2.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AgentID is the ID of the agent to connect to.
	AgentID uuid.UUID `json:"agent_id"`
	// ConnectionMode is the strategy to use when connecting to the agent.
	ConnectionMode ConnectionMode `json:"connection_mode"`
	// HoldDuration is the duration to hold the connection open for. If set to
	// 0, the connection will be closed immediately after making each request
	// once.
	HoldDuration httpapi.Duration `json:"hold_duration"`

	// Connections is the list of connections to make to services running
	// inside the workspace. Only HTTP connections are supported.
	Connections []Connection `json:"connections"`
}

func (Config) Validate

func (c Config) Validate() error

type Connection

type Connection struct {
	// URL is the address to connect to (e.g. "http://127.0.0.1:8080/path"). The
	// endpoint must respond with a any response within timeout. The IP address
	// is ignored and the connection is made to the agent's WireGuard IP
	// instead.
	URL string `json:"url"`
	// Interval is the duration to wait between connections to this endpoint. If
	// set to 0, the connection will only be made once. Must be set to 0 if
	// the parent config's hold_duration is set to 0.
	Interval httpapi.Duration `json:"interval"`
	// Timeout is the duration to wait for a connection to this endpoint to
	// succeed. If set to 0, the default timeout will be used.
	Timeout httpapi.Duration `json:"timeout"`
}

type ConnectionMode

type ConnectionMode string
const (
	ConnectionModeDirect ConnectionMode = "direct"
	ConnectionModeDerp   ConnectionMode = "derp"
)

type Runner

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

func NewRunner

func NewRunner(client *codersdk.Client, cfg Config) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, _ string, w io.Writer) error

Run implements Runnable.

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy