router

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONCE_COUNT       = 1024 * 1024
	INPUT_BUFFER_SIZE = 10 * 1024 * 1024
	STORING_TIMEOUT   = 60 * time.Second
)
View Source
const AddressBytesSize = 30
View Source
const AddressSize = int((AddressBytesSize * 8) / 5)
View Source
const (
	VERSION = int(24)
)

Variables

This section is empty.

Functions

func CheckHash

func CheckHash(hash []byte, complexity byte) bool

func CurrentExePath

func CurrentExePath() string

func RSAPublicKeyFromDer

func RSAPublicKeyFromDer(publicKeyDer []byte) (publicKey *rsa.PublicKey, err error)

func SplitRequest

func SplitRequest(path string) []string

Types

type HttpServer

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

func NewHttpServer

func NewHttpServer() *HttpServer

func (*HttpServer) ServeHTTP added in v0.2.8

func (c *HttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HttpServer) Start

func (c *HttpServer) Start(server *Router, port int)

func (*HttpServer) Stop

func (c *HttpServer) Stop() error

type Message

type Message struct {
	TouchDT time.Time
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(id uint64, data []byte) *Message

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) DebugString

func (c *Router) DebugString() (result []byte)

func (*Router) DeclareHttpRequestD

func (c *Router) DeclareHttpRequestD()

func (*Router) DeclareHttpRequestF

func (c *Router) DeclareHttpRequestF()

func (*Router) DeclareHttpRequestN

func (c *Router) DeclareHttpRequestN()

func (*Router) DeclareHttpRequestNS

func (c *Router) DeclareHttpRequestNS()

func (*Router) DeclareHttpRequestR

func (c *Router) DeclareHttpRequestR()

func (*Router) DeclareHttpRequestS

func (c *Router) DeclareHttpRequestS()

func (*Router) DeclareHttpRequestW

func (c *Router) DeclareHttpRequestW()

func (*Router) GetMessages

func (c *Router) GetMessages(frame []byte) (response []byte, count int, err error)

Get message request

func (*Router) Put

func (c *Router) Put(frame []byte)

func (*Router) Start

func (c *Router) Start() error

func (*Router) StatString

func (c *Router) StatString() (result []byte)

func (*Router) Stop

func (c *Router) Stop() error

type RouterSpeedStatistics

type RouterSpeedStatistics struct {
	SpeedHttpRequests   int `json:"http_requests"`
	SpeedHttpRequestsR  int `json:"http_requests_r"`
	SpeedHttpRequestsW  int `json:"http_requests_w"`
	SpeedHttpRequestsN  int `json:"http_requests_n"`
	SpeedHttpRequestsNS int `json:"http_requests_ns"`
	SpeedHttpRequestsD  int `json:"http_requests_d"`
	SpeedHttpRequestsF  int `json:"http_requests_f"`

	SpeedFramesIn  int `json:"frames_in"`
	SpeedFramesOut int `json:"frames_out"`
	SpeedBytesIn   int `json:"bytes_in"`
	SpeedBytesOut  int `json:"bytes_out"`

	SpeedBytesKIn  int `json:"kilobytes_in"`
	SpeedBytesKOut int `json:"kilobytes_out"`

	SpeedBytesMIn  int `json:"megabytes_in"`
	SpeedBytesMOut int `json:"megabytes_out"`

	Version int `json:"version"`
}

type RouterStatistics

type RouterStatistics struct {
	FramesIn  int `json:"frames_in"`
	FramesOut int `json:"frames_out"`
	BytesIn   int `json:"bytes_in"`
	BytesOut  int `json:"bytes_out"`

	HttpRequests   int `json:"http_requests"`
	HttpRequestsR  int `json:"http_requests_r"`
	HttpRequestsW  int `json:"http_requests_w"`
	HttpRequestsN  int `json:"http_requests_n"`
	HttpRequestsNS int `json:"http_requests_ns"`
	HttpRequestsD  int `json:"http_requests_d"`
	HttpRequestsS  int `json:"http_requests_s"`
	HttpRequestsF  int `json:"http_requests_f"`
}

type Storage

type Storage struct {
	TouchDT time.Time
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage() *Storage

func (*Storage) Clear

func (c *Storage) Clear()

func (*Storage) GetMessage

func (c *Storage) GetMessage(afterId uint64, maxSize uint64) (data []byte, lastId uint64, count int)

func (*Storage) MessagesCount

func (c *Storage) MessagesCount() (count int)

func (*Storage) Put

func (c *Storage) Put(id uint64, frame []byte)

Jump to

Keyboard shortcuts

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