domain

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package domain provides core domain models for Moley.

Package domain provides core domain models for Moley.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Target TargetConfig `yaml:"target" json:"target" validate:"required"`
	Expose ExposeConfig `yaml:"expose" json:"expose" validate:"required"`
}

type ExposeConfig

type ExposeConfig struct {
	Subdomain string `yaml:"subdomain" json:"subdomain" validate:"required"`
}

type Ingress

type Ingress struct {
	Zone string      `yaml:"zone" json:"zone" validate:"required"`
	Apps []AppConfig `yaml:"apps" json:"apps" validate:"required,dive"`
	Mode IngressMode `yaml:"mode" json:"mode" validate:"required,oneof=wildcard subdomain"`
}

type IngressMode added in v2.3.0

type IngressMode string
const (
	// IngressModeWildcard creates a single *.zone DNS record.
	// Cloudflared routes requests by hostname in ingress rules.
	// Best for: development, frequently changing apps, faster iteration.
	// DNS: *.example.com → tunnel (1 record)
	IngressModeWildcard IngressMode = "wildcard"

	// IngressModeSubdomain creates individual DNS records per app.
	// Each app gets its own subdomain.domain DNS entry.
	// Best for: production, explicit DNS control, stable apps.
	// DNS: api.example.com → tunnel, app.example.com → tunnel (N records)
	IngressModeSubdomain IngressMode = "subdomain"
)

type State

type State string

State represents the operational state of a resource.

const (
	StateUp      State = "up"
	StateDown    State = "down"
	StateUnknown State = "unknown" // Unable to determine state (e.g., error during check)
)

type TargetConfig

type TargetConfig struct {
	Port     int            `yaml:"port" json:"port" validate:"required,min=1,max=65535"`
	Hostname string         `yaml:"hostname" json:"hostname" validate:"required"`
	Protocol TargetProtocol `yaml:"protocol" json:"protocol" validate:"required,oneof=http https tcp"`
}

func (*TargetConfig) GetTargetURL

func (t *TargetConfig) GetTargetURL() string

type TargetProtocol added in v2.2.3

type TargetProtocol string
const (
	ProtocolTCP   TargetProtocol = "tcp"
	ProtocolHTTP  TargetProtocol = "http"
	ProtocolHTTPS TargetProtocol = "https"
)

type Tunnel

type Tunnel struct {
	ID         string `yaml:"id" json:"id" validate:"required"`
	Persistent bool   `yaml:"persistent" json:"persistent" validate:"-"`
}

func NewTunnel

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

func (*Tunnel) GetName

func (t *Tunnel) GetName() string

Jump to

Keyboard shortcuts

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