modulepackage
0.0.0-20240827151230-599b65724b48
Repository: https://github.com/domonda/go-function.git
Documentation: pkg.go.dev
# README
go-function
Wrapping Go functions as HTTP handlers and CLI commands
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DetectContentType tries to detect the MIME content-type of data, or returns "application/octet-stream" if none could be identified.
No description provided by the author
HTTPHandlerNoWrapper returns an http.Handler for a function without a wrapper of type func(context.Context) ([]byte, error) that returns response bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HTTPRequestMultipartFormArgs returns the multipart form values of the request as string map.
No description provided by the author
HTTPRequestQueryArgs returns the query params of the request as string map.
No description provided by the author
LogTo calls logger.Printf(fmt.Sprintln(results...)).
LogWithPrefixTo calls logger.Printf(fmt.Sprintln(results...)) with prefix prepended to the results.
No description provided by the author
MustReflectWrapper calls ReflectWrapper and panics any error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NoArgNoResultWrapper returns a Wrapper for a function call without arguments and without results.
PrintlnTo calls fmt.Fprintln on writer for every result.
PrintlnWithPrefix calls fmt.Println(prefix, result) for every result value.
PrintlnWithPrefixTo calls fmt.Fprintln(writer, prefix, result) for every result value.
PrintTo calls fmt.Fprint on writer with the result values as varidic arguments.
No description provided by the author
ReflectType returns the reflect.Type of the generic type T.
ReflectWrapper returns a Wrapper for the passed function using reflection and the passed argNames.
RespondBinary responds with contentType using the binary data from results of type []byte, string, or io.Reader.
No description provided by the author
No description provided by the author
ScanString uses the configured DefaultStringScanner to scan sourceStr to destPtr.
ScanStrings uses the configured DefaultStringScanner to scan sourceStrings to destPtrs.
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
ErrTypeNotSupported indicates that a type is not supported.
HandleErrorHTTP will handle a non nil error by writing it to the response.
No description provided by the author
No description provided by the author
Println calls fmt.Println for every result.
PrintStructSliceAsTable prints a slice of structs or struct pointers as a padded table to os.Stdout using fmt.Sprint to format field values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeFormats used in that order to try parse time strings.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Logger interface.
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PrintlnText prints a fixed string if a command returns without an error.
RespondRedirect implements HTTPResultsWriter and http.Handler with for a redirect URL string.
RespondRedirectFunc implements HTTPResultsWriter and http.Handler with a function that returns the redirect URL.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author