server

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 20 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 GetSid added in v0.1.8

func GetSid(hdr http.Header) (sid string)

func Route

func Route(ctx *b.Context, spec m.Map, hdlr RqHandler,
	req *http.Request, rsp http.ResponseWriter)

func SetSid added in v0.1.9

func SetSid(hdr http.Header, sid string)

Types

type RqActionHandler

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

func GetActionHandler

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

type RqHandler added in v0.1.13

type RqHandler = func(*b.Context, m.Map,
	*http.Request, http.ResponseWriter)

func GetRequestHandler added in v0.1.13

func GetRequestHandler(ctx *b.Context, spec m.Map) (string, RqHandler)

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
	Timestamp int64 // check lifetime/clean-up - when?
	Data      m.Map // metadata, e.g. about user, ...
}

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