net

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogEntry

func GetLogEntry(r *http.Request) logrus.FieldLogger

func HandleMonitorRequest

func HandleMonitorRequest(w http.ResponseWriter, r *http.Request)

HandleMonitorRequest handles the monitor http request. events are emitted to the monitor event channel.

func LogEntrySetField

func LogEntrySetField(r *http.Request, key string, value any)

func LogEntrySetFields

func LogEntrySetFields(r *http.Request, fields map[string]any)

func NewHttpLogger

func NewHttpLogger() func(next http.Handler) http.Handler

func ScanJsonDelimitedFile added in v0.8.0

func ScanJsonDelimitedFile(fn string, sleep time.Duration, repeat int, emitter chan []byte)

Types

type Server

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

func NewHTTPServer

func NewHTTPServer() *Server

func (Server) Address

func (s Server) Address() string

func (*Server) Restart

func (s *Server) Restart(ctx context.Context, addr string) error

func (*Server) Router

func (s *Server) Router() chi.Router

func (*Server) Start

func (s *Server) Start(addr string) error

func (*Server) Stop added in v0.8.0

func (s *Server) Stop()

type SimuRpcHandler

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

func NewSimuRpcHandler

func NewSimuRpcHandler(simu *sim.Simulation) *SimuRpcHandler

func (SimuRpcHandler) HandleMessage

func (s SimuRpcHandler) HandleMessage(r *rpc.Request) error

type StructuredLogger

type StructuredLogger struct {
	LogEntry *logrus.Entry
}

func (*StructuredLogger) NewLogEntry

func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry

type StructuredLoggerEntry

type StructuredLoggerEntry struct {
	Logger logrus.FieldLogger
}

func (*StructuredLoggerEntry) Panic

func (l *StructuredLoggerEntry) Panic(v any, stack []byte)

func (*StructuredLoggerEntry) Write

func (l *StructuredLoggerEntry) Write(status, bytes int, header http.Header, elapsed time.Duration, extra any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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