util

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType   = "Content-Type"
	MIMEApplicationJSON = "application/json"
)
View Source
const RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"

Variables

This section is empty.

Functions

func MarshalStringerAsJSON

func MarshalStringerAsJSON(s Stringer) ([]byte, error)

func SetJSONHeader

func SetJSONHeader(req *http.Request)

SetJSONHeader sets the Content-Type header to application/json.

func WriteTemplateToFile

func WriteTemplateToFile(tmpl *template.Template, filename string, data any) error

WriteTemplateToFile writes the template with the given data to the filename.

Types

type Stringer

type Stringer interface {
	String() string
}

Jump to

Keyboard shortcuts

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