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 ¶
Types ¶
type Access ¶
type Access struct {
Policies []Policy `yaml:"policies,omitempty"`
}
func (*Access) HasPolicies ¶
type AccessConfig ¶
type AccessConfig struct {
Providers []string `yaml:"providers,omitempty" json:"providers,omitempty"`
Raw map[string]any `yaml:",remain" json:"-"`
}
AccessConfig holds the raw Cloudflare Access application configuration. Fields match the CF API shape and are passed through with minimal transformation. Only `providers` is processed by Moley (resolved to IdP UUIDs); everything else is forwarded to the Cloudflare API as-is.
func (AccessConfig) MarshalJSON ¶
func (a AccessConfig) MarshalJSON() ([]byte, error)
MarshalJSON inlines Raw so policy changes are reflected in the input hash.
type AppConfig ¶
type AppConfig struct {
Target TargetConfig `yaml:"target" json:"target" validate:"required"`
Expose ExposeConfig `yaml:"expose" json:"expose" validate:"required"`
Access *AccessConfig `yaml:"access,omitempty" json:"access,omitempty" validate:"omitempty"`
Policies []string `yaml:"policies,omitempty" json:"policies,omitempty"`
}
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"`
}
func (*Ingress) HasAccessConfig ¶
type IngressMode ¶
type IngressMode string
const ( // IngressModeWildcard — best for development and frequently changing apps; one DNS record covers all subdomains. IngressModeWildcard IngressMode = "wildcard" // IngressModeSubdomain — best for production; each app gets its own explicit DNS record. IngressModeSubdomain IngressMode = "subdomain" )
type Policy ¶
type Policy struct {
Name string `yaml:"name" json:"name" validate:"required"`
Extra map[string]any `yaml:",remain" json:"-"`
}
Policy is a named, reusable Cloudflare Access policy. Name is the reference key; all other fields are CF API fields passed through as-is.
func (Policy) MarshalJSON ¶
MarshalJSON inlines Extra so the full CF policy body is produced on serialization.
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 ¶
type TargetProtocol string
const ( ProtocolTCP TargetProtocol = "tcp" ProtocolHTTP TargetProtocol = "http" ProtocolHTTPS TargetProtocol = "https" )