assetserver

package
v2.0.0-...-21d7e90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
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 GetMimetype

func GetMimetype(filename string, data []byte) string

func NewAssetHandler

func NewAssetHandler(ctx context.Context, options *options.App) (http.Handler, error)

Types

type AssetServer

type AssetServer struct {
	// contains filtered or unexported fields
}

func NewAssetServer

func NewAssetServer(ctx context.Context, options *options.App, bindingsJSON string) (*AssetServer, error)

func NewAssetServerWithHandler

func NewAssetServerWithHandler(ctx context.Context, handler http.Handler, bindingsJSON string) (*AssetServer, error)

func (*AssetServer) ProcessHTTPRequest

func (d *AssetServer) ProcessHTTPRequest(logInfo string, 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL