http

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeError

func EncodeError(w http.ResponseWriter, response error)

EncodeError encodes the error to JSON and writes it to the response writer

func EncodeResponse

func EncodeResponse(w http.ResponseWriter, response interface{})

EncodeResponse encodes the response to JSON and writes it to the response writer

func StartHttpService added in v0.0.4

func StartHttpService(mhs MoshaHttpService) error

StartHttpService starts a Mosha HTTP service.

Types

type IdResponse added in v0.0.2

type IdResponse struct {
	ID string `json:"id"`
}

IdResponse represents a response with an id.

type MoshaHttpService added in v0.0.4

type MoshaHttpService interface {
	MakeHandler() http.Handler
	GetPort() string
	GetName() string
}

MoshaHttpService is an interface for any Mosha HTTP service.

Jump to

Keyboard shortcuts

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