Documentation ¶
Index ¶
- Constants
- func CompactSite(aofPath string)
- func ParseBytes(s string) (uint64, error)
- func Run(conf ServerConf)
- type App
- type AppMode
- type AppRequest
- type Auth
- type AuthConf
- type AuthHandler
- type BootMsg
- type Broker
- type Buf
- type BufD
- type BufEntry
- type Cache
- type Card
- type CardD
- type Client
- type Conf
- type Cur
- type CycBuf
- type CycBufD
- type DebugHandler
- type DirServer
- type FileServer
- type FixBuf
- type FixBufD
- type ListBuf
- type ListBufD
- type Log
- type LoginHandler
- type LogoutHandler
- type MapBuf
- type MapBufD
- type Meta
- type Msg
- type MsgT
- type MultipartFrame
- type MultipartServer
- type MultipartSource
- type Namespace
- type OpD
- type OpsD
- type Page
- type PageD
- type Proxy
- type ProxyRequest
- type ProxyResponse
- type ProxyResult
- type Pub
- type RefreshHandler
- type RegisterApp
- type ServerConf
- type Session
- type Shard
- type Site
- type SocketServer
- type Sub
- type Typ
- type UnregisterApp
- type UploadResponse
- type WebServer
Constants ¶
const ( // TODO: Refactor into iota. STATE_CREATED = "CREATED" STATE_TIMEOUT = "TIMEOUT" STATE_LISTEN = "LISTEN" STATE_RECONNECT = "RECONNECT" STATE_DISCONNECT = "DISCONNECT" STATE_CLOSED = "CLOSED" )
const ( BYTE = 1 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE PETABYTE EXABYTE )
Variables ¶
This section is empty.
Functions ¶
func CompactSite ¶ added in v0.14.0
func CompactSite(aofPath string)
func ParseBytes ¶ added in v0.14.0
ParseBytes parses string representations (e.g. 42K or 42KB or 42KiB) to bytes
Types ¶
type AppRequest ¶
type AppRequest struct { RegisterApp *RegisterApp `json:"register_app,omitempty"` UnregisterApp *UnregisterApp `json:"unregister_app,omitempty"` }
AppRequest represents a request from an app.
type AuthHandler ¶ added in v0.14.0
type AuthHandler struct {
// contains filtered or unexported fields
}
AuthHandler handles OAuth2 requests
func (*AuthHandler) ServeHTTP ¶ added in v0.14.0
func (h *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type BootMsg ¶ added in v0.25.3
type BootMsg struct { Data struct { Hash string `json:"#,omitempty"` // location hash SubmissionName string `json:"__wave_submission_name__,omitempty"` // mark the cause of the serve invocation } `json:"data"` Headers http.Header `json:"headers"` // forwarded headers }
BootMsg represents the initial message sent to an app when a client first connects to it.
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker represents a message broker.
type Buf ¶
type Buf interface {
// contains filtered or unexported methods
}
Buf represents a generic dictionary-like buffer.
type BufD ¶
type BufD struct { C *CycBufD `json:"c,omitempty"` F *FixBufD `json:"f,omitempty"` M *MapBufD `json:"m,omitempty"` L *ListBufD `json:"l,omitempty"` }
BufD represents the marshaled data for a buffer. This is a discriminated union.
type BufEntry ¶ added in v1.0.0
type BufEntry struct {
// contains filtered or unexported fields
}
Tmp placeholder for key-buffer pairs.
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card represents an item on a Page, and holds attributes and data for rendering views.
type CardD ¶
type CardD struct { D map[string]interface{} `json:"d"` // data B []BufD `json:"b,omitempty"` // buffers }
CardD represents the marshaled data for a Card.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represent a websocket (UI) client.
type Conf ¶ added in v0.26.0
type Conf struct { Version bool `cfg:"version" env:"H2O_WAVE_VERSION" cfgDefault:"false"` Listen string `cfg:"listen" env:"H2O_WAVE_LISTEN" cfgDefault:":10101" cfgHelper:"listen on this address"` BaseUrl string `` /* 175-byte string literal not displayed */ WebDir string `cfg:"web-dir" env:"H2O_WAVE_WEB_DIR" cfgDefault:"./www" cfgHelper:"directory to serve web assets from, hosted at /"` DataDir string `cfg:"data-dir" env:"H2O_WAVE_DATA_DIR" cfgDefault:"./data" cfgHelper:"directory to store site data"` PublicDirs string `` /* 296-byte string literal not displayed */ PrivateDirs string `` /* 325-byte string literal not displayed */ AccessKeyID string `cfg:"access-key-id" env:"H2O_WAVE_ACCESS_KEY_ID" cfgDefault:"access_key_id" cfgHelper:"default API access key ID"` AccessKeySecret string `` /* 129-byte string literal not displayed */ AccessKeyFile string `` /* 132-byte string literal not displayed */ CreateAccessKey bool `` /* 160-byte string literal not displayed */ ListAccessKeys bool `` /* 129-byte string literal not displayed */ RemoveAccessKeyID string `` /* 139-byte string literal not displayed */ Init string `cfg:"init" env:"H2O_WAVE_INIT" cfgDefault:"" cfgHelper:"initialize site content from AOF log"` Compact string `cfg:"compact" env:"H2O_WAVE_COMPACT" cfgDefault:"" cfgHelper:"compact AOF log"` CertFile string `cfg:"tls-cert-file" env:"H2O_WAVE_TLS_CERT_FILE" cfgDefault:"" cfgHelper:"path to certificate file (TLS only)"` KeyFile string `cfg:"tls-key-file" env:"H2O_WAVE_TLS_KEY_FILE" cfgDefault:"" cfgHelper:"path to private key file (TLS only)"` SkipCertVerification bool `` /* 167-byte string literal not displayed */ HttpHeadersFile string `` /* 183-byte string literal not displayed */ ForwardedHttpHeaders string `` /* 323-byte string literal not displayed */ Editable bool `cfg:"editable" env:"H2O_WAVE_EDITABLE" cfgDefault:"false" cfgHelper:"allow users to edit web pages"` MaxRequestSize string `` /* 159-byte string literal not displayed */ MaxCacheRequestSize string `` /* 177-byte string literal not displayed */ Proxy bool `` /* 169-byte string literal not displayed */ MaxProxyRequestSize string `` /* 165-byte string literal not displayed */ MaxProxyResponseSize string `` /* 168-byte string literal not displayed */ SessionExpiry string `` /* 141-byte string literal not displayed */ InactivityTimeout string `` /* 167-byte string literal not displayed */ PingInterval string `` /* 194-byte string literal not displayed */ NoStore bool `` /* 138-byte string literal not displayed */ NoLog bool `` /* 155-byte string literal not displayed */ Debug bool `cfg:"debug" env:"H2O_WAVE_DEBUG" cfgDefault:"false" cfgHelper:"enable debug mode (profiling, inspection, etc.)"` ClientID string `cfg:"oidc-client-id" env:"H2O_WAVE_OIDC_CLIENT_ID" cfgDefault:"" cfgHelper:"OIDC client ID"` ClientSecret string `cfg:"oidc-client-secret" env:"H2O_WAVE_OIDC_CLIENT_SECRET" cfgDefault:"" cfgHelper:"OIDC client secret"` ProviderUrl string `cfg:"oidc-provider-url" env:"H2O_WAVE_OIDC_PROVIDER_URL" cfgDefault:"" cfgHelper:"OIDC provider URL"` RedirectUrl string `cfg:"oidc-redirect-url" env:"H2O_WAVE_OIDC_REDIRECT_URL" cfgDefault:"" cfgHelper:"OIDC redirect URL"` EndSessionUrl string `cfg:"oidc-end-session-url" env:"H2O_WAVE_OIDC_END_SESSION_URL" cfgDefault:"" cfgHelper:"OIDC end session URL"` PostLogoutRedirectUrl string `` /* 136-byte string literal not displayed */ RawAuthScopes string `` /* 142-byte string literal not displayed */ RawAuthURLParams string `` /* 219-byte string literal not displayed */ SkipLogin bool `` /* 139-byte string literal not displayed */ KeepAppLive bool `cfg:"keep-app-live" env:"H2O_WAVE_KEEP_APP_LIVE" cfgDefault:"false" cfgHelper:"do not unregister unresponsive apps"` Conf string `cfg:"conf" env:"H2O_WAVE_CONF" cfgDefault:".env" cfgHelper:"path to configuration file"` ReconnectTimeout string `` /* 138-byte string literal not displayed */ AllowedOrigins string `` /* 163-byte string literal not displayed */ }
type Cur ¶
type Cur struct {
// contains filtered or unexported fields
}
Cur represents a type-aware cursor for accessing fields in a tuple.
type CycBuf ¶
type CycBuf struct {
// contains filtered or unexported fields
}
CycBuf represents a cyclic buffer.
type CycBufD ¶
type CycBufD struct { F []string `json:"f"` // fields D [][]interface{} `json:"d"` // tuples N int `json:"n"` // size I int `json:"i"` // index }
CycBufD represents the marshaled data for a CycBuf.
type DebugHandler ¶
type DebugHandler struct {
// contains filtered or unexported fields
}
DebugHandler is a HTTP handler for site profiling.
func (*DebugHandler) ServeHTTP ¶
func (h *DebugHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type DirServer ¶ added in v0.18.0
type DirServer struct {
// contains filtered or unexported fields
}
DirServer represents a file server for arbitrary directories.
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
FileServer represents a file server.
func (*FileServer) ServeHTTP ¶
func (fs *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FixBuf ¶
type FixBuf struct {
// contains filtered or unexported fields
}
FixBuf represents a fixed-sized buffer.
type FixBufD ¶
type FixBufD struct { F []string `json:"f"` // fields D [][]interface{} `json:"d"` // tuples N int `json:"n"` // size }
FixBufD represents the marshaled data for a FixBuf.
type ListBuf ¶ added in v0.26.0
type ListBuf struct {
// contains filtered or unexported fields
}
ListBuf represents a list (dynamic array) buffer.
type LoginHandler ¶ added in v0.14.0
type LoginHandler struct {
// contains filtered or unexported fields
}
LoginHandler handles auth requests
func (*LoginHandler) ServeHTTP ¶ added in v0.14.0
func (h *LoginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LogoutHandler ¶ added in v0.14.0
type LogoutHandler struct {
// contains filtered or unexported fields
}
LogoutHandler handles logout requests
func (*LogoutHandler) ServeHTTP ¶ added in v0.14.0
func (h *LogoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MapBuf ¶
type MapBuf struct {
// contains filtered or unexported fields
}
MapBuf represents a map (dictionary) buffer.
type MapBufD ¶
type MapBufD struct { F []string `json:"f"` // fields D map[string][]interface{} `json:"d"` // tuples }
MapBufD represents the marshaled data for a MapBuf.
type Meta ¶ added in v0.13.0
type Meta struct { Username string `json:"u"` // active user's username Editor bool `json:"e"` // can the user edit pages? }
Meta represents metadata unrelated to commands
type MultipartFrame ¶ added in v0.18.0
type MultipartFrame struct {
// contains filtered or unexported fields
}
MultipartFrame represents a single frame in a multipart stream.
type MultipartServer ¶ added in v0.18.0
MultipartServer handles multipart/x-mixed-replace content.
func (*MultipartServer) ServeHTTP ¶ added in v0.18.0
func (s *MultipartServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MultipartSource ¶ added in v0.18.0
MultipartSource represents a source of multipart data.
type OpD ¶
type OpD struct { K string `json:"k,omitempty"` // key; ""=drop page V interface{} `json:"v,omitempty"` // value C *CycBufD `json:"c,omitempty"` // value F *FixBufD `json:"f,omitempty"` // value M *MapBufD `json:"m,omitempty"` // value L *ListBufD `json:"l,omitempty"` // value D map[string]interface{} `json:"d,omitempty"` // card data B []BufD `json:"b,omitempty"` // card buffers }
OpD represents a delta operation (effector) Discriminated union; valid combos: K, set:KV|KC|KF|KM, put:KD|KDB
type OpsD ¶
type OpsD struct { P *PageD `json:"p,omitempty"` // page D []OpD `json:"d,omitempty"` // deltas R int `json:"r,omitempty"` // reset U string `json:"u,omitempty"` // redirect E string `json:"e,omitempty"` // error M *Meta `json:"m,omitempty"` // metadata C int `json:"c,omitempty"` // clear UI state I string `json:"i,omitempty"` // client id }
OpsD represents the set of changes to be applied to a Page. This is a discriminated union.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy represents a HTTP proxy
type ProxyRequest ¶
type ProxyRequest struct { Method string `json:"method"` URL string `json:"url"` Headers map[string][]string `json:"headers"` Body string `json:"body"` }
ProxyRequest represents the request to be sent to the upstream server.
type ProxyResponse ¶
type ProxyResponse struct { Status string `json:"status"` Code int `json:"code"` Headers map[string][]string `json:"headers"` Body string `json:"body"` }
ProxyResponse represents the response received from the upstream server.
type ProxyResult ¶
type ProxyResult struct { Error string `json:"error"` Result *ProxyResponse `json:"result"` }
ProxyResult represents the result returned for a proxy request.
type Pub ¶
type Pub struct {
// contains filtered or unexported fields
}
Pub represents a published message
type RefreshHandler ¶ added in v0.23.0
type RefreshHandler struct {
// contains filtered or unexported fields
}
Handles token refreshes.
func (*RefreshHandler) ServeHTTP ¶ added in v0.23.0
func (h *RefreshHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RegisterApp ¶
type RegisterApp struct { Mode string `json:"mode"` Route string `json:"route"` Address string `json:"address"` KeyID string `json:"key_id"` KeySecret string `json:"key_secret"` }
RegisterApp represents a request to register an app.
type ServerConf ¶
type ServerConf struct { Version string BuildDate string Listen string BaseURL string WebDir string DataDir string PublicDirs []string PrivateDirs []string Keychain *keychain.Keychain Init string Compact string CertFile string SkipCertVerification bool KeyFile string Header http.Header Editable bool MaxRequestSize int64 MaxCacheRequestSize int64 Proxy bool MaxProxyRequestSize int64 MaxProxyResponseSize int64 NoStore bool NoLog bool IDE bool Debug bool Auth *AuthConf ForwardedHeaders map[string]bool KeepAppLive bool PingInterval time.Duration ReconnectTimeout time.Duration AllowedOrigins map[string]bool }
ServerConf represents Server configuration options.
type SocketServer ¶
type SocketServer struct {
// contains filtered or unexported fields
}
SocketServer represents a websocket server.
func (*SocketServer) ServeHTTP ¶
func (s *SocketServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Sub ¶
type Sub struct {
// contains filtered or unexported fields
}
Sub represents a subscription.
type Typ ¶
type Typ struct {
// contains filtered or unexported fields
}
Typ represents a data type.
type UnregisterApp ¶
type UnregisterApp struct {
Route string `json:"route"`
}
UnregisterApp represents a request to unregister an app.
type UploadResponse ¶
type UploadResponse struct {
Files []string `json:"files"`
}
UploadResponse represents a response to a file upload operation.