web

package
Version: v0.0.0-...-2eeffc0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAppIsFinished

func ErrAppIsFinished(err error) render.Renderer

func ErrInternalServer

func ErrInternalServer(err error) render.Renderer

func ErrInvalidRequest

func ErrInvalidRequest(err error) render.Renderer

func ErrNotFoundRequest

func ErrNotFoundRequest(err error) render.Renderer

func ErrRender

func ErrRender(err error) render.Renderer

func ErrUnauthenticated

func ErrUnauthenticated(err error) render.Renderer

func Serve

func Serve(s *master.Master, adminPassword string, logger logger.Logger)

Serve start a web server with given gobench server

Types

type Err

type Err struct {
	Code    int    `json:"code,omitempty"`    // application-specific error code
	Message string `json:"message,omitempty"` // application-level error message, for debugging
	Status  string `json:"status"`            // user-level status message
}

Err is the error struct that compatible to Google API recommendation https://cloud.google.com/apis/design/errors#error_model

type ErrResponse

type ErrResponse struct {
	Error Err `json:"error"`
}

ErrResponse is the error struct that compatible to Google API recommendation https://cloud.google.com/apis/design/errors#error_model

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL