server

package
v0.0.0-...-9f93016 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WsRecv   string = "ServerWsReceive"
	ResReady string = "ServerResponseReady"
)

Variables

This section is empty.

Functions

func CheckOrigin

func CheckOrigin(req *http.Request) bool

func CheckOriginStub

func CheckOriginStub(req *http.Request) bool

func NewOkEvtStub

func NewOkEvtStub() event.IEvt[any]

Types

type JsonStub

type JsonStub struct {
	Kind string
}

type Server

type Server struct {
	Config config.Server
	Evt    *event.EvtChans
	// contains filtered or unexported fields
}

func (*Server) New

func (this *Server) New() *Server

func (*Server) NewTest

func (this *Server) NewTest() *ServerBuilder

func (*Server) Start

func (this *Server) Start()

func (*Server) StartTest

func (this *Server) StartTest() *httptest.Server

func (*Server) Stop

func (this *Server) Stop()

type ServerBuilder

type ServerBuilder struct {
	Server *Server
	// contains filtered or unexported fields
}

func (ServerBuilder) Build

func (this ServerBuilder) Build() *Server

func (*ServerBuilder) CheckOrigin

func (this *ServerBuilder) CheckOrigin(fn TCheckOrigin) *ServerBuilder

type TCheckOrigin

type TCheckOrigin func(req *http.Request) bool

Jump to

Keyboard shortcuts

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