Documentation ¶
Index ¶
- Constants
- func GetContextWithThisTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- func GetContextWithTimeout(ctx context.Context) (context.Context, context.CancelFunc)
- func QuoteBytes(buf []byte) string
- func QuoteString(str string) string
- func RandomString(n int) string
- func SanitizeSQL(sql string, args ...interface{}) (string, error)
- func SendNotification(ctx context.Context, projectId string, topic string, data map[string]string) error
- func WriteError(w http.ResponseWriter, statusCode int, errorMessage string)
- func WriteInternalServerError(w http.ResponseWriter)
- func WriteJson(w http.ResponseWriter, res interface{})
- func WriteOK(w http.ResponseWriter)
- func WriteStatus(w http.ResponseWriter, statusCode int)
- func WriteUnauthorized(w http.ResponseWriter)
- type DatabaseLogger
- type Part
- type Query
- type Result
Constants ¶
View Source
const (
CONTEXT_TIMEOUT = 5 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func GetContextWithTimeout ¶
func QuoteBytes ¶
func QuoteString ¶
func RandomString ¶
func SanitizeSQL ¶
SanitizeSQL replaces placeholder values with args. It quotes and escapes args as necessary. This function is only safe when standard_conforming_strings is on.
func SendNotification ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, statusCode int, errorMessage string)
func WriteInternalServerError ¶
func WriteInternalServerError(w http.ResponseWriter)
func WriteJson ¶
func WriteJson(w http.ResponseWriter, res interface{})
func WriteOK ¶
func WriteOK(w http.ResponseWriter)
func WriteStatus ¶
func WriteStatus(w http.ResponseWriter, statusCode int)
func WriteUnauthorized ¶
func WriteUnauthorized(w http.ResponseWriter)
Types ¶
type DatabaseLogger ¶
type DatabaseLogger struct{}
type Part ¶
type Part interface{}
Part is either a string or an int. A string is raw SQL. An int is a argument placeholder.
Click to show internal directories.
Click to hide internal directories.