Documentation ¶
Overview ¶
Code from https://github.com/erikdubbelboer/ringqueue
The MIT License (MIT)
Copyright (c) 2015 Erik Dubbelboer ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func BuildAssetServerConfig(appOptions *options.App) (assetserver.Options, error)
- func FindEmbedRootPath(fsys embed.FS) (string, error)
- func FindPathToFile(fsys fs.FS, file string) (string, error)
- func GetMimetype(filename string, data []byte) string
- func NewAssetHandler(options assetserver.Options, log Logger) (http.Handler, error)
- type AssetServer
- func NewAssetServer(bindingsJSON string, options assetserver.Options, servingFromDisk bool, ...) (*AssetServer, error)
- func NewAssetServerMainPage(bindingsJSON string, options *options.App, servingFromDisk bool, logger Logger, ...) (*AssetServer, error)
- func NewAssetServerWithHandler(handler http.Handler, bindingsJSON string, servingFromDisk bool, logger Logger, ...) (*AssetServer, error)
- func (d *AssetServer) AddPluginScript(pluginName string, script string)
- func (d *AssetServer) ProcessHTTPRequestLegacy(rw http.ResponseWriter, reqGetter func() (*http.Request, error))
- func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (d *AssetServer) ServeWebViewRequest(req webview.Request)
- func (d *AssetServer) UseRuntimeHandler(handler RuntimeHandler)
- type Logger
- type RuntimeAssets
- type RuntimeHandler
Constants ¶
const ( HeaderHost = "Host" HeaderContentType = "Content-Type" HeaderContentLength = "Content-Length" HeaderUserAgent = "User-Agent" HeaderCacheControl = "Cache-Control" HeaderUpgrade = "Upgrade" WailsUserAgentValue = "wails.io" )
Variables ¶
This section is empty.
Functions ¶
func BuildAssetServerConfig ¶
func BuildAssetServerConfig(appOptions *options.App) (assetserver.Options, error)
func FindEmbedRootPath ¶
FindEmbedRootPath finds the root path in the embed FS. It's the directory which contains all the files.
func GetMimetype ¶
func NewAssetHandler ¶
Types ¶
type AssetServer ¶
type AssetServer struct {
// contains filtered or unexported fields
}
func NewAssetServer ¶
func NewAssetServer(bindingsJSON string, options assetserver.Options, servingFromDisk bool, logger Logger, runtime RuntimeAssets) (*AssetServer, error)
func NewAssetServerMainPage ¶
func NewAssetServerMainPage(bindingsJSON string, options *options.App, servingFromDisk bool, logger Logger, runtime RuntimeAssets) (*AssetServer, error)
func NewAssetServerWithHandler ¶
func NewAssetServerWithHandler(handler http.Handler, bindingsJSON string, servingFromDisk bool, logger Logger, runtime RuntimeAssets) (*AssetServer, error)
func (*AssetServer) AddPluginScript ¶
func (d *AssetServer) AddPluginScript(pluginName string, script string)
func (*AssetServer) ProcessHTTPRequestLegacy ¶
func (d *AssetServer) ProcessHTTPRequestLegacy(rw http.ResponseWriter, reqGetter func() (*http.Request, error))
ProcessHTTPRequest processes the HTTP Request by faking a golang HTTP Server. The request will be finished with a StatusNotImplemented code if no handler has written to the response.
func (*AssetServer) ServeHTTP ¶
func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*AssetServer) ServeWebViewRequest ¶
func (d *AssetServer) ServeWebViewRequest(req webview.Request)
ServeWebViewRequest processes the HTTP Request asynchronously by faking a golang HTTP Server. The request will be finished with a StatusNotImplemented code if no handler has written to the response. The AssetServer takes ownership of the request and the caller mustn't close it or access it in any other way.
func (*AssetServer) UseRuntimeHandler ¶
func (d *AssetServer) UseRuntimeHandler(handler RuntimeHandler)
type RuntimeAssets ¶
type RuntimeHandler ¶
type RuntimeHandler interface {
HandleRuntimeCall(w http.ResponseWriter, r *http.Request)
}