server

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 13 Imported by: 5

Documentation

Overview

Package server provides network listeners, e.g. an HTTP (web/REST/JSON) server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAction

func DefaultAction(ctx *b.Context, spec m.Map, msg *b.Message,
	rsp http.ResponseWriter, s *Session)

func DoneHandler

func DoneHandler(ctx *b.Context) (loop bool)

func GetSid added in v0.1.8

func GetSid(hdrp *http.Header) (sid string)

func LoginAction added in v0.1.8

func LoginAction(ctx *b.Context, spec m.Map, msg *b.Message,
	rsp http.ResponseWriter, s *Session)

func PollAction

func PollAction(ctx *b.Context, spec m.Map, pollmsg *b.Message,
	rsp http.ResponseWriter, s *Session)

func Route

func Route(ctx *b.Context, rsp http.ResponseWriter, req *http.Request)

func SetSid added in v0.1.9

func SetSid(hdr *http.Header, sid string)

func StartServer

func StartServer(ctx *b.Context)

func SyncAction

func SyncAction(ctx *b.Context, spec m.Map, msg *b.Message,
	rsp http.ResponseWriter, s *Session)

Types

type RqActionHandler

type RqActionHandler = func(
	*b.Context, m.Map, *b.Message, http.ResponseWriter, *Session)

func GetActionHandler

func GetActionHandler(ctx *b.Context, spec m.Map, msg *b.Message) RqActionHandler

type ServerState added in v0.1.8

type ServerState struct {
	Server   *http.Server
	Sessions *Sessions
}

func (*ServerState) GetSessionMailbox added in v0.1.8

func (st *ServerState) GetSessionMailbox(sid string) chan b.Message

type Session added in v0.1.8

type Session struct {
	Mailbox   chan b.Message
	SessionId string
}

type Sessions added in v0.1.8

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

func (*Sessions) Get added in v0.1.8

func (s *Sessions) Get(ctx *b.Context, sid string) *Session

Jump to

Keyboard shortcuts

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