net

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthCheck added in v0.3.0

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

func JSONError added in v0.3.0

func JSONError(w http.ResponseWriter, httpStatus int, err error)

func JSONResponse added in v0.3.0

func JSONResponse(w http.ResponseWriter, httpStatus int, response any)

Types

type HandshakeData added in v0.2.0

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

type HealthStatus added in v0.3.0

type HealthStatus struct {
	Status string `json:"status"`
}

type Networking

type Networking struct {
	HandshakeChan chan *SuccessfulHandshakeData
	// contains filtered or unexported fields
}

func NewNetworking

func NewNetworking(cfg *config.Config, db *storage.Database, mqtt safemqtt.Client) *Networking

func (*Networking) HandShake

func (n *Networking) HandShake(w http.ResponseWriter, r *http.Request)

func (*Networking) ListenAndServe

func (n *Networking) ListenAndServe(address, port string) error

func (*Networking) PreHandShake

func (n *Networking) PreHandShake(response http.ResponseWriter, request *http.Request) (*HandshakeData, bool)

PreHandShake TODO: it's "god" method needs to be simplified // antst: agree :)

func (*Networking) ReadyCheck added in v0.3.0

func (n *Networking) ReadyCheck(w http.ResponseWriter, r *http.Request)

type ReadyStatus added in v0.3.0

type ReadyStatus struct {
	Database   string `json:"database"`
	MessageBus string `json:"messageBus"`
}

type SuccessfulHandshakeData

type SuccessfulHandshakeData struct {
	Connection *socket.Connection
	UserID     uuid.UUID
	SessionID  uuid.UUID
	URL        *url.URL
}

Jump to

Keyboard shortcuts

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