handlers

package
Version: v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootHandler = func(w http.ResponseWriter, r *http.Request) {

	if r.RequestURI == "/paysim/" {
		resourceName := docDir + "\\html\\" + "index.html"
		http.ServeFile(w, r, resourceName)
		return
	}

	if strings.HasSuffix(r.RequestURI, ".html") || strings.HasSuffix(r.RequestURI, ".js") {
		tmp := strings.Split(r.RequestURI, "/")
		lastResourceName := tmp[len(tmp)-1:]
		subDir := "scripts"
		if strings.HasSuffix(r.RequestURI, ".html") {
			subDir = "html"
		}

		resourceName := docDir + "\\" + subDir + "\\" + lastResourceName[0]
		log.Println("serving static resource ", resourceName)
		http.ServeFile(w, r, resourceName)
	}

}

Functions

This section is empty.

Types

type ParseTraceHandlerHandler

type ParseTraceHandlerHandler struct {
}

func (*ParseTraceHandlerHandler) ServeHTTP

func (handler *ParseTraceHandlerHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PaysimDefaultHandler

type PaysimDefaultHandler struct {
}

func (*PaysimDefaultHandler) ServeHTTP

func (handler *PaysimDefaultHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type SendMessageHandlerHandler

type SendMessageHandlerHandler struct {
}

func (*SendMessageHandlerHandler) ServeHTTP

func (handler *SendMessageHandlerHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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