helpers

package
v0.0.0-...-46021d3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailOnError

func FailOnError(err error, msg string)

FailOnError Fatal error when fail

func ParseInt64

func ParseInt64(stringToParse string) (int64, error)

ParseInt64 helper to avoid code repetition

func WriteErrorJSON

func WriteErrorJSON(w http.ResponseWriter, status int, message string)

WriteErrorJSON writes a json error

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v interface{})

WriteJSON writes json value

Types

type StatusResponse

type StatusResponse struct {
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

StatusResponse is a status response model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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