Documentation ¶
Index ¶
- Constants
- Variables
- func ClientConfigPath() (string, error)
- func ValidateAppConfig(conf *AppConfig) error
- func ValidateDNSLabel(value string) bool
- func ValidateDuration(value string) bool
- func ValidateSiteConfig(conf *SiteConfig) error
- type ACL
- type ACLSubjectRule
- type AccessLevel
- type AccessRule
- type AppConfig
- type AppDeploymentsConfig
- type AppDomainConfig
- type AppSiteConfig
- type ClientConfig
- type Config
- type HostIDScheme
- type HostPattern
- type Loader
- type SiteConfig
- type SitesConfig
- type SitesConfigEntry
Constants ¶
View Source
const DefaultHostPattern = `http://*.localhost:8001`
View Source
const DefaultSite = "main"
View Source
const SiteConfigName = "pageship"
View Source
const SitesConfigName = "sites"
Variables ¶
View Source
var ErrConfigNotFound = errors.New("config not found")
Functions ¶
func ClientConfigPath ¶
func ValidateAppConfig ¶
func ValidateDNSLabel ¶
func ValidateDuration ¶
func ValidateSiteConfig ¶
func ValidateSiteConfig(conf *SiteConfig) error
Types ¶
type ACLSubjectRule ¶
type ACLSubjectRule struct { PageshipUser string `json:"pageshipUser,omitempty" pageship:"max=100"` GitHubUser string `json:"githubUser,omitempty" pageship:"max=100"` GitHubRepositoryActions string `json:"gitHubRepositoryActions,omitempty" pageship:"max=100"` IpRange string `json:"ipRange,omitempty" pageship:"omitempty,max=100,cidr"` }
func (*ACLSubjectRule) String ¶
func (c *ACLSubjectRule) String() string
type AccessLevel ¶
type AccessLevel string
const ( AccessLevelAdmin AccessLevel = "admin" AccessLevelDeployer AccessLevel = "deployer" AccessLevelReader AccessLevel = "reader" AccessLevelDefault = AccessLevelReader )
func (AccessLevel) CanAccess ¶
func (l AccessLevel) CanAccess(a AccessLevel) bool
func (AccessLevel) IsValid ¶
func (l AccessLevel) IsValid() bool
type AccessRule ¶
type AccessRule struct { ACLSubjectRule `mapstructure:",squash"` Access AccessLevel `json:"access" pageship:"omitempty,accessLevel"` }
func (*AccessRule) SetDefaults ¶
func (r *AccessRule) SetDefaults()
type AppConfig ¶
type AppConfig struct { ID string `json:"id" pageship:"required,dnsLabel"` DefaultSite string `json:"defaultSite" pageship:"required,dnsLabel"` Sites []AppSiteConfig `json:"sites" pageship:"max=10,dive,required"` Deployments AppDeploymentsConfig `json:"deployments"` Team []*AccessRule `json:"team" pageship:"max=100,dive,required"` Domains []AppDomainConfig `json:"domains" pageship:"max=10,unique=Domain,unique=Site,dive,required"` }
func DefaultAppConfig ¶
func DefaultAppConfig() AppConfig
func (*AppConfig) ResolveDomain ¶ added in v0.5.0
func (c *AppConfig) ResolveDomain(domain string) (resolved AppDomainConfig, ok bool)
func (*AppConfig) ResolveSite ¶
func (c *AppConfig) ResolveSite(site string) (resolved AppSiteConfig, ok bool)
func (*AppConfig) SetDefaults ¶
func (c *AppConfig) SetDefaults()
type AppDeploymentsConfig ¶
type AppDeploymentsConfig struct { Access ACL `json:"access" pageship:"omitempty"` TTL string `json:"ttl" pageship:"omitempty,duration"` }
func (*AppDeploymentsConfig) SetDefaults ¶
func (c *AppDeploymentsConfig) SetDefaults()
type AppDomainConfig ¶ added in v0.5.0
type AppSiteConfig ¶
type AppSiteConfig struct { Name string `json:"name" pageship:"excluded_with=Pattern,dnsLabel"` Pattern string `json:"pattern,omitempty" pageship:"excluded_with=Name,max=100,regexp"` }
func (*AppSiteConfig) CompilePattern ¶
func (c *AppSiteConfig) CompilePattern() (*regexp.Regexp, error)
type ClientConfig ¶
type ClientConfig struct { APIServer string `json:"apiServer,omitempty"` GitHubUsername string `json:"githubUsername,omitempty"` SSHKeyFile string `json:"sshKeyFile,omitempty"` AuthToken string `json:"authToken,omitempty"` }
func LoadClientConfig ¶
func LoadClientConfig() (*ClientConfig, error)
func (*ClientConfig) Save ¶
func (c *ClientConfig) Save() error
type Config ¶
type Config struct { App AppConfig `json:"app"` Site SiteConfig `json:"site"` }
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type HostIDScheme ¶
type HostIDScheme string
const ( HostIDSchemeSubdomain HostIDScheme = "subdomain" HostIDSchemeSuffix HostIDScheme = "suffix" HostIDSchemeDefault = HostIDSchemeSubdomain )
func (HostIDScheme) IsValid ¶
func (s HostIDScheme) IsValid() bool
type HostPattern ¶
func NewHostPattern ¶
func NewHostPattern(pattern string) *HostPattern
func (*HostPattern) MakeDomain ¶
func (p *HostPattern) MakeDomain(value string) string
func (*HostPattern) MakeURL ¶
func (p *HostPattern) MakeURL(value string) string
func (*HostPattern) MatchString ¶
func (p *HostPattern) MatchString(s string) (string, bool)
type SiteConfig ¶
type SiteConfig struct { Public string `json:"public" pageship:"required"` Access ACL `json:"access" pageship:"omitempty"` }
func DefaultSiteConfig ¶
func DefaultSiteConfig() SiteConfig
type SitesConfig ¶
type SitesConfig struct {
Sites map[string]SitesConfigEntry `json:"sites,omitempty"`
}
func DefaultSitesConfig ¶
func DefaultSitesConfig() *SitesConfig
type SitesConfigEntry ¶
Click to show internal directories.
Click to hide internal directories.