tunnel

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TunnelConfigFile = "moley.yml"
)

Variables

MoleyConfig represents the configuration manager for the tunnel

Functions

func NewTunnelConfigManager added in v1.2.0

func NewTunnelConfigManager() *shared.BaseConfigManager[TunnelConfig]

Types

type Runner

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

Runner provides a high-level API for tunnel operations

func NewRunner

func NewRunner(manager *Service) (*Runner, error)

NewRunner creates a new tunnel service

func (*Runner) DeployAndRun

func (s *Runner) DeployAndRun(ctx context.Context) error

DeployAndRun deploys the tunnel and runs it until interrupted

type Service

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

Service orchestrates tunnel deployment and cleanup

func NewService

func NewService(globalConfig *config.GlobalConfig, tunnelConfig *TunnelConfig, tunnelName string) (*Service, error)

NewService creates a new tunnel manager

func (*Service) Cleanup

func (m *Service) Cleanup(ctx context.Context) error

Cleanup cleans up the tunnel resources

func (*Service) Deploy

func (m *Service) Deploy(ctx context.Context) error

Deploy deploys the tunnel without running cloudflared

func (*Service) Revert

func (m *Service) Revert(ctx context.Context, steps []steps.Step) error

Revert tunnel resources

func (*Service) Run

func (m *Service) Run(ctx context.Context) error

Run runs the cloudflared tunnel

type TunnelConfig

type TunnelConfig struct {
	// Zone is the DNS zone to use for the tunnel
	Zone string `mapstructure:"zone" yaml:"zone" json:"zone" validate:"required"`
	// Apps is a list of applications to expose via the tunnel
	Apps []domain.AppConfig `mapstructure:"apps" yaml:"apps" json:"apps" validate:"required,min=1"`
}

TunnelConfig holds the configuration for the tunnel feature

func GetDefaultConfig

func GetDefaultConfig() *TunnelConfig

GetDefaultConfig returns the default tunnel configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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