webserver

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevInfoDbKey     = "DeviceInfoDbKey_"
	DevInfoDBKeyHead = DevInfoDbKey + "0_"
	DevInfoDBKeyEnd  = DevInfoDbKey + "1_"
)
View Source
const (
	AppBundle = "com.hop.ninja.light"
)

Variables

View Source
var InvalidRequest, _ = json.Marshal("not a post request")
View Source
var JsonErr = webmsg.ParseJsonErr.PackResult("parse json error")

Functions

func Md5

func Md5(str string) string

func StartWebDaemon

func StartWebDaemon()

func StopWebDaemon

func StopWebDaemon()

Types

type AndroidPush

type AndroidPush struct {
}

func (*AndroidPush) Push

func (ap *AndroidPush) Push(deviceToken, title string, debug bool) error

type BodyAndroid

type BodyAndroid struct {
	Ticker    string `json:"ticker"`
	Title     string `json:"title"`
	Text      string `json:"text"`
	AfterOpen string `json:"after_open"`
	Activity  string `json:"activity"`
}

type IOSPush

type IOSPush struct {
	*apns2.Client
}

func (*IOSPush) Push

func (ip *IOSPush) Push(token, msg string, debug bool) error

type PayloadAndroid

type PayloadAndroid struct {
	DisplayType string            `json:"display_type"`
	Body        *BodyAndroid      `json:"body"`
	Extra       map[string]string `json:"extra"`
}

type PushClient

type PushClient interface {
	Push(token, msg string, debug bool) error
}

type RegexpHandler

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

func (*RegexpHandler) Handle

func (rh *RegexpHandler) Handle(pattern string, handler http.Handler)

func (*RegexpHandler) HandleFunc

func (rh *RegexpHandler) HandleFunc(pattern string, handleFunc func(http.ResponseWriter, []byte))

func (*RegexpHandler) HandleFuncDirect

func (rh *RegexpHandler) HandleFuncDirect(pattern string, handlerFunc http.HandlerFunc)

func (*RegexpHandler) ServeHTTP

func (rh *RegexpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UMAndroid

type UMAndroid struct {
	AppKey    string `json:"appkey"`
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`

	DeviceTokens   string          `json:"device_tokens"`
	ProductionMode string          `json:"production_mode"`
	Payload        *PayloadAndroid `json:"payload"`
	Description    string          `json:"description"`
}

type WebProxyServer

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

func NewWebServer

func NewWebServer(networkAddr string) *WebProxyServer

func (*WebProxyServer) Shutdown

func (ws *WebProxyServer) Shutdown() error

func (*WebProxyServer) Start

func (ws *WebProxyServer) Start() error

Jump to

Keyboard shortcuts

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