goweb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: BSD-2-Clause Imports: 17 Imported by: 0

README

goweb

Web server implementation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddlewareCollection

func NewMiddlewareCollection(config Config, app gocli.Application, maxLogBodySize int64) *middlewareCollection

New Middleware Collection Init Method

Types

type Application

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

Web Application

func NewApplication

func NewApplication(config Config, app gocli.Application, connState func(net.Conn, http.ConnState)) *Application

Init Web Application

func (*Application) Listen

func (a *Application) Listen(routes http.Handler)

Make server and listen

type BindingIdentifier

type BindingIdentifier interface{}

Identifier for bind with connection

type Config

type Config struct {
	Port    int
	Host    string
	Url     string
	Timeout struct {
		Read  int
		Write int
		Idle  int
	}
}

Web config

type ConnectionBindings

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

Bindings

func NewConnectionBindings

func NewConnectionBindings() *ConnectionBindings

New bindings

func (*ConnectionBindings) Bind

Associate connection with id

func (*ConnectionBindings) GetBindingId

Get participantId by connection id

func (*ConnectionBindings) GetConnectionId

Get connection Id by id

func (*ConnectionBindings) UnBind

Unbind connection with id

type ConnectionEvent

type ConnectionEvent struct {
	Name ConnectionEventName
	Done chan bool
}

Events that can be

type ConnectionEventListeners

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

Listeners struct

func NewConnectionEventListeners

func NewConnectionEventListeners() *ConnectionEventListeners

New Connection event Listener

func (*ConnectionEventListeners) Dispatch

Dispatch event

func (*ConnectionEventListeners) Get

Get events

func (*ConnectionEventListeners) Register

Register connection listener

func (*ConnectionEventListeners) Unregister

Unregister connection event listener

func (*ConnectionEventListeners) UnregisterConnection

Unregister connection listener

type ConnectionEventName

type ConnectionEventName string

Event Name

type ConnectionIdentifier

type ConnectionIdentifier string

Connection unique identifier

type Connections

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

Connections

func NewConnections

func NewConnections() *Connections

Init tcp connection pool

func (*Connections) Get

Get connection if exists

func (*Connections) Len

func (cs *Connections) Len() int

Connections len

func (*Connections) Set

Set connection

func (*Connections) Unset

Unset connection if exists

Jump to

Keyboard shortcuts

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