domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTunnelName

func NewTunnelName() string

NewTunnelName generates a unique name for a tunnel using the current timestamp and random bytes

Types

type AppConfig

type AppConfig struct {
	// Target is the target application configuration
	Target TargetConfig `mapstructure:"target" yaml:"target" json:"target" validate:"required"`
	// Expose is the exposure configuration for the application
	Expose ExposeConfig `mapstructure:"expose" yaml:"expose" json:"expose" validate:"required"`
}

AppConfig represents a single application to expose

type DNS

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

DNS represents the DNS configuration for multiple apps

func NewDNS

func NewDNS(zone string, apps []AppConfig) *DNS

NewDNS creates a new DNS configuration with the provided apps

func NewDefaultDNS

func NewDefaultDNS() *DNS

NewDefaultDNS creates a DNS configuration with a default app

func (*DNS) GetApps

func (c *DNS) GetApps() []AppConfig

GetApps returns the list of apps configured in the DNS

func (*DNS) GetSubdomains

func (c *DNS) GetSubdomains() []string

GetSubdomains returns all hostnames for all apps

func (*DNS) GetZone

func (c *DNS) GetZone() string

GetZone returns the DNS zone for the apps

type ExposeConfig

type ExposeConfig struct {
	// Subdomain is the subdomain under which the application will be exposed
	Subdomain string `mapstructure:"subdomain" yaml:"subdomain" json:"subdomain" validate:"required"`
}

ExposeConfig represents the exposure configuration

type TargetConfig

type TargetConfig struct {
	// Port is the port on which the target application is running
	Port int `mapstructure:"port" yaml:"port" json:"port" validate:"required,min=1,max=65535"`
	// Hostname is the hostname or IP address of the target application
	Hostname string `mapstructure:"hostname" yaml:"hostname" json:"hostname" validate:"required"`
}

TargetConfig represents the target application configuration

func (*TargetConfig) GetTargetURL

func (t *TargetConfig) GetTargetURL() string

GetTargetURL constructs the URL for the target application

type Tunnel

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

Tunnel represents a Cloudflare tunnel

func NewTunnel

func NewTunnel(name string) (*Tunnel, error)

NewTunnel creates a new Tunnel instance with the specified name

func (*Tunnel) GetName

func (t *Tunnel) GetName() string

GetName returns the name of the tunnel

Jump to

Keyboard shortcuts

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