utils

package
v0.0.0-...-953a1d1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(h http.HandlerFunc) http.HandlerFunc

CheckToken - Checking token wrap.

func NotifyChan

func NotifyChan(in chan os.Signal)

NotifyChan Linking in chan to os terminate signals.

func Respond

func Respond(w http.ResponseWriter, data map[string]interface{}, stCode int)

Respond - create HTTP answer with data field and stCode for status

func RespondError

func RespondError(writer http.ResponseWriter, err error, status int)

RespondError - Sending error response

func WaitSignals

func WaitSignals(ctx context.Context) error

Types

type SimpleError

type SimpleError struct {
	Msg  string // message text
	Code int    // error code
}

SimpleError Common error struct (for sending to web).

func MakeErr

func MakeErr(err string) SimpleError

Jump to

Keyboard shortcuts

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