tool

package
v0.0.0-...-7064c7c Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJsonRequest

func DecodeJsonRequest(r *http.Request, interfaceRef interface{}) error

func GetDynamicPath

func GetDynamicPath(path string) string

func RunJob

func RunJob(job Job)

func ValidateRequest

func ValidateRequest(data interface{}) error

func View

func View(path string, w http.ResponseWriter, content *interface{})

Types

type Job

type Job struct {
	Handler    JobHandler
	Args       []byte
	DidSucceed JobResponseHandler
	DidFail    JobResponseHandler
	DidTimeOut JobResponseHandler
	Timeout    time.Duration
	RetryCount int
}

type JobHandler

type JobHandler = func([]byte) error

type JobResponse

type JobResponse struct {
	Error     error
	Completed bool
}

type JobResponseHandler

type JobResponseHandler = func(error)

Jump to

Keyboard shortcuts

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