Documentation ¶
Index ¶
- type AppManifest
- type AppOptions
- type Manager
- func (m *Manager) AcquireLock() (interface{}, error)
- func (m *Manager) AddSite(site *SiteState) error
- func (m *Manager) DeleteSite(domain string) error
- func (m *Manager) DumpState() (*NodeState, error)
- func (m *Manager) GetSecret(key string) ([]byte, error)
- func (m *Manager) GetSite(domain string) *SiteState
- func (m *Manager) GetSites() []SiteState
- func (m *Manager) Init() (err error)
- func (m *Manager) LastUpdated() *time.Time
- func (m *Manager) OnStateUpdate(callback func())
- func (m *Manager) ReleaseLock(leaseID interface{}) error
- func (m *Manager) ReplaceState(state *NodeState) error
- func (m *Manager) SetSecret(key string, value []byte) error
- func (m *Manager) StoreHealth() (healthy bool, err error)
- func (m *Manager) UpdateSite(site *SiteState, setUpdated bool) error
- type NodeState
- type SiteApp
- type SiteState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppManifest ¶
type AppManifest struct { Files map[string]AppOptions `yaml:"files"` Locations map[string]AppOptions `yaml:"locations"` Rewrite map[string]string `yaml:"rewrite"` Page403 string `yaml:"page403"` Page404 string `yaml:"page404"` }
AppManifest represents the manifest of an app
type AppOptions ¶
type AppOptions struct { ClientCaching string `yaml:"clientCaching"` Headers map[string]string `yaml:"headers"` CleanHeaders map[string]string `yaml:"-"` }
AppOptions is used by the AppManifest struct to represent options for a specific location or file type
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the state manager class
var Instance *Manager
Instance is a singleton for Manager
func (*Manager) AcquireLock ¶
AcquireLock acquires a lock on the state before making changes, across all nodes in the cluster
func (*Manager) DeleteSite ¶
DeleteSite remvoes a site from the store
func (*Manager) LastUpdated ¶
LastUpdated returns the time the state was updated last
func (*Manager) OnStateUpdate ¶
func (m *Manager) OnStateUpdate(callback func())
OnStateUpdate stores the callback to invoke if the state is updated because of an external event
func (*Manager) ReleaseLock ¶
ReleaseLock releases the lock on the state
func (*Manager) ReplaceState ¶
ReplaceState replaces the full state for the node with the provided one
func (*Manager) StoreHealth ¶
StoreHealth returns true if the store is healthy
type NodeState ¶
type NodeState struct { Sites []SiteState `json:"sites"` Secrets map[string][]byte `json:"secrets"` }
NodeState represents the global state of the node
type SiteApp ¶
type SiteApp struct { // App details Name string `json:"name" binding:"required"` Version string `json:"version" binding:"required"` // App manifest (for internal use) Manifest *AppManifest `json:"-"` }
SiteApp represents the state of an app deployed or being deployed
type SiteState ¶
type SiteState struct { // Configuration TLSCertificateSelfSigned bool `json:"tlsCertificateSelfSigned"` TLSCertificate *string `json:"tlsCertificate"` TLSCertificateVersion *string `json:"tlsCertificateVersion"` // Domains: primary and aliases Domain string `json:"domain" binding:"required,ne=_default"` Aliases []string `json:"aliases" binding:"dive,ne=_default"` // Deployment error Error error `json:"-"` ErrorStr *string `json:"error" binding:"-"` // Not allowed as input // App App *SiteApp `json:"app"` }
SiteState represents the state of a single site