net

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 13 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 interface{})

func LogEntrySetFields

func LogEntrySetFields(r *http.Request, fields map[string]interface{})

func NewHttpLogger

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

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

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.RpcRequest) 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 interface{}, stack []byte)

func (*StructuredLoggerEntry) Write

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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