udpserver

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsDebug = true
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(svr *UDPQuicServer, conn quic.Connection)

Types

type Client

type Client struct {
	ID         string
	RemoteAddr string
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close()

type Context

type Context struct {
	Keys map[string]any
	// contains filtered or unexported fields
}

func (*Context) Abort

func (c *Context) Abort()

func (*Context) BindJson

func (c *Context) BindJson(obj any) error

func (*Context) Body

func (c *Context) Body() []byte

func (*Context) Get

func (c *Context) Get(key string) (value any, exists bool)

func (*Context) GetBool

func (c *Context) GetBool(key string) (b bool)

func (*Context) GetDuration

func (c *Context) GetDuration(key string) (d time.Duration)

func (*Context) GetFloat64

func (c *Context) GetFloat64(key string) (f64 float64)

func (*Context) GetInt

func (c *Context) GetInt(key string) (i int)

func (*Context) GetInt64

func (c *Context) GetInt64(key string) (i64 int64)

func (*Context) GetString

func (c *Context) GetString(key string) (s string)

func (*Context) GetStringMap

func (c *Context) GetStringMap(key string) (sm map[string]any)

func (*Context) GetStringMapString

func (c *Context) GetStringMapString(key string) (sms map[string]string)

func (*Context) GetStringMapStringSlice

func (c *Context) GetStringMapStringSlice(key string) (smss map[string][]string)

func (*Context) GetStringSlice

func (c *Context) GetStringSlice(key string) (ss []string)

func (*Context) GetTime

func (c *Context) GetTime(key string) (t time.Time)

func (*Context) GetUint

func (c *Context) GetUint(key string) (ui uint)

func (*Context) GetUint64

func (c *Context) GetUint64(key string) (ui64 uint64)

func (*Context) Json

func (c *Context) Json(id string, data any)

func (*Context) Next

func (c *Context) Next()

func (*Context) Render

func (c *Context) Render(id string, msg []byte)

func (*Context) Set

func (c *Context) Set(key string, val any)

func (*Context) String

func (c *Context) String(id, body string)

type HandlerFunc

type HandlerFunc func(*Context)

type Message

type Message struct {
	ID   string
	Body []byte
}

type Option

type Option func(opt *option)

func WithHandler

func WithHandler(handles ...HandlerFunc) Option

func WithTLSFile

func WithTLSFile(certFile, keyFile string) Option

type UDPQuicServer

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

func New

func New(opts ...Option) *UDPQuicServer

func (*UDPQuicServer) Name

func (uq *UDPQuicServer) Name() string

func (*UDPQuicServer) SendMessage

func (uq *UDPQuicServer) SendMessage(msg []byte)

func (*UDPQuicServer) Start

func (uq *UDPQuicServer) Start(ctx context.Context) error

func (*UDPQuicServer) Stop

func (uq *UDPQuicServer) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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