funcli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	ConnectArgs *ConnectCommand `arg:"subcommand:connect" help:"Connect to a funcie deployment to allow local development."`
	Environment string          `arg:"--env" help:"Funcie environment used if multiple deployments are present." default:"default"`

	VersionString string `arg:"-"`
}

Cli is the top-level command-line arguments.

func NewCli

func NewCli(connectArgs *ConnectCommand) *Cli

func (*Cli) Version

func (c *Cli) Version() string

type ConfigStore

type ConfigStore interface {
	// GetConfigValue retrieves the value of a configuration key.
	GetConfigValue(ctx context.Context, key string) (string, error)
}

ConfigStore retrieves dynamic configuration values on-demand.

func NewConfigStore

func NewConfigStore(environment string, ssmClient SsmParameterStore) ConfigStore

NewConfigStore creates a new ConfigStore.

type ConnectCommand

type ConnectCommand struct {
	RemoteHost string `arg:"--remote-host,-r" help:"Override the remote host to connect to instead of the Redis default."`
	RemotePort int    `arg:"--remote-port,-p" help:"Override the remote port to bind to." default:"6379"`
	LocalPort  int    `arg:"--local-port,-l" help:"Override the local port to bind to." default:"6379"`
	// contains filtered or unexported fields
}

func NewConnectCommand

func NewConnectCommand(configStore ConfigStore, connectClient SsmConnectClient, tunneller Tunneller) *ConnectCommand

func (*ConnectCommand) Run

func (c *ConnectCommand) Run(ctx context.Context) error

type ConnectivityService

type ConnectivityService interface {
	// WaitForConnectivity waits for the given endpoint to be reachable, or the context to be done.
	WaitForConnectivity(ctx context.Context, endpoint string) error
}

ConnectivityService provides utilities for testing / awaiting internet connectivity.

func NewHttpConnectivityService

func NewHttpConnectivityService(opts ...HttpConnectivityServiceOptionSetter) ConnectivityService

NewHttpConnectivityService creates a new HttpConnectivityService with optional settings.

type HttpConnectivityServiceOptionSetter

type HttpConnectivityServiceOptionSetter func(*HttpConnectivityServiceOptions)

func WithRetryInterval

func WithRetryInterval(interval time.Duration) HttpConnectivityServiceOptionSetter

WithRetryInterval sets the retry interval for the HttpConnectivityService.

type HttpConnectivityServiceOptions

type HttpConnectivityServiceOptions struct {
	RetryInterval time.Duration
}

type SsmConnectClient

type SsmConnectClient interface {
	StartSession(ctx context.Context, params *ssm.StartSessionInput, optFns ...func(*ssm.Options)) (*ssm.StartSessionOutput, error)
	TerminateSession(ctx context.Context, params *ssm.TerminateSessionInput, optFns ...func(*ssm.Options)) (*ssm.TerminateSessionOutput, error)
}

type SsmParameterStore

type SsmParameterStore interface {
	GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
}

type TunnelOptions

type TunnelOptions struct {
	// Headers is a map of headers to send with the connection request.
	Headers    http.Header
	Output     ssm.StartSessionOutput
	InstanceId string
}

TunnelOptions provides optional arguments for creating a network tunnel.

type Tunneller

type Tunneller interface {
	// OpenTunnel starts a tunnel to a remote host on the given port locally.
	OpenTunnel(ctx context.Context, endpoint string, localPort int, opts *TunnelOptions) error
}

Tunneller is an interface for creating a tunnel to a remote host.

func NewWebhookTunneller

func NewWebhookTunneller() Tunneller

NewWebhookTunneller creates a new WebhookTunnel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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