sprocket

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthenticatedSession

func CheckAuthenticatedSession(next http.HandlerFunc, cookieStore *sessions.CookieStore, cookieName string) http.HandlerFunc

CheckAuthenticatedSession ...

func ExtractQueryParamAsInt

func ExtractQueryParamAsInt(r *http.Request, name string, defaultValue int) int

ExtractQueryParamAsInt ...

func ExtractQueryParamAsString

func ExtractQueryParamAsString(r *http.Request, name string, defaultValue string) string

ExtractQueryParamAsString ...

func GetTemplates

func GetTemplates(viewFS *embed.FS, patterns []string, filenames []string) (*template.Template, error)

GetTemplates ...

func InterfaceArrayToStringArray

func InterfaceArrayToStringArray(t []interface{}) []string

InterfaceArrayToStringArray ...

func InterfaceToString

func InterfaceToString(v interface{}) string

InterfaceToString ...

func JustJSONMarshal

func JustJSONMarshal(v interface{}) string

JustJSONMarshal ...

func LoadYAML

func LoadYAML(filename string, configuration interface{}) error

LoadYAML used to load config.yml into the program

func MetaValueStringExtractor

func MetaValueStringExtractor(v interface{}) string

MetaValueStringExtractor ...

func ParseToDatabaseDate

func ParseToDatabaseDate(layout string, v string) interface{}

ParseToDatabaseDate a helper method to parse string to time layout example `02/01/2006`

func RespondBadRequestJSON

func RespondBadRequestJSON(w http.ResponseWriter, payload interface{})

RespondBadRequestJSON ...

func RespondInternalServerError

func RespondInternalServerError(w http.ResponseWriter, payload interface{})

RespondInternalServerError ...

func RespondNotFoundJSON

func RespondNotFoundJSON(w http.ResponseWriter, payload interface{})

RespondNotFoundJSON ...

func RespondNotImplementedJSON

func RespondNotImplementedJSON(w http.ResponseWriter, payload interface{})

RespondNotImplementedJSON ...

func RespondOkayJSON

func RespondOkayJSON(w http.ResponseWriter, payload interface{})

RespondOkayJSON ...

func RespondStatusCodeWithJSON

func RespondStatusCodeWithJSON(w http.ResponseWriter, statusCode int, payload interface{})

RespondStatusCodeWithJSON ...

func RowScanWrap

func RowScanWrap(r *sql.Row, dest ...interface{}) error

RowScanWrap ...

func RowsScanWrap

func RowsScanWrap(r *sql.Rows, dest ...interface{}) error

RowsScanWrap ...

func TransactionQuery

func TransactionQuery(db *sqlx.DB, query string, args ...interface{}) (sql.Result, error)

TransactionQuery ...

func TxTransactionQuery

func TxTransactionQuery(tx *sqlx.Tx, query string, args ...interface{}) (sql.Result, error)

TxTransactionQuery ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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