util

package
v0.0.0-...-7c1aaf1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

Check if a file exists

func ReadFile

func ReadFile(path string) []byte

Read a file, exit if err

func WriteError

func WriteError(w http.ResponseWriter, r *http.Request, e error, s int, m string)

Writes error response back to the client Logs the error if it is an actual server error (err != nil)

func WriteFile

func WriteFile(path string, data []byte)

Write a file, exit if err

func WriteResponse

func WriteResponse[R any](r R, w http.ResponseWriter, status int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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