Documentation
¶
Index ¶
- Constants
- Variables
- func BoolFlag(varName *bool, name string, defVal bool, description string)
- func Counter(name string, value int, sampling float64) error
- func Ctx2ConnInfo(ctx context.Context) (string, error)
- func Ctx2Db(ctx context.Context) (*sqlx.DB, error)
- func Ctx2SessionKey(ctx context.Context) (string, error)
- func Ctx2Tx(ctx context.Context) (*sqlx.Tx, error)
- func DecodeEID(eid string, model string) (string, error)
- func EncodeID(id int64, model string) string
- func Exec(ctx context.Context, q string, args ...interface{}) error
- func Gauge(name string, value int) error
- func GetContext() (context.Context, error)
- func GetIPFromRequest(r *http.Request) (string, error)
- func GetRandomString(size int) string
- func GetTrackerFromRequest(r *http.Request) string
- func Init()
- func IntFlag(varName *int, name string, defVal int, description string)
- func LoggerStatter(r *log15.Record) error
- func LvlFilterHandler(exactLvl log15.Lvl, h log15.Handler) log15.Handler
- func NotifyR2D2(oid, app, okind, ekind string, edata, odata interface{}) error
- func NullString(val *string) sql.NullString
- func QueryIntoInt(ctx context.Context, q string, args ...interface{}) (int, error)
- func QueryIntoMap(ctx context.Context, q string, args ...interface{}) (map[string]interface{}, error)
- func QueryIntoSlice(ctx context.Context, v interface{}, q string, args ...interface{}) error
- func QueryIntoString(ctx context.Context, q string, args ...interface{}) (string, error)
- func QueryIntoStruct(ctx context.Context, v interface{}, q string, args ...interface{}) error
- func SetLoggingVerbosity(level int)
- func StringFlag(varName *string, name string, defVal string, description string)
- func Timer(name string, tt time.Duration) error
- type AError
- type LoggerStatsType
- type NullPgJson
- type PgJson
Constants ¶
View Source
const ( KeyDBTransaction = "dbtx" KeyDB = "db" KeySession = "http-session-id" KeyConnInfo = "conninfo" )
View Source
const (
KeyWG = "wg"
)
Variables ¶
View Source
var ( Listen = ":8000" DbName = "" DbHost = "127.0.0.1" DbPort = 5432 DbUser = "user" DbPass = "" Verbosity = 4 Secret = "" Config = "" CreateConf = false Debug = true Sentry = "" UseSession = true UseTransaction = true StatsD = "" App = "acko" FLAGSET *flag.FlagSet = nil Confs map[string]interface{} )
View Source
var ( LETTERS = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") DIGITS = []byte("1234567890") )
View Source
var ( LOGGER log15.Logger LOGGER_STATS_Lock sync.Mutex LOGGER_STATS = &LoggerStatsType{} )
Functions ¶
func GetContext ¶
func GetRandomString ¶
func GetTrackerFromRequest ¶
func LoggerStatter ¶
func NotifyR2D2 ¶
func NullString ¶
func NullString(val *string) sql.NullString
func QueryIntoInt ¶
func QueryIntoMap ¶
func QueryIntoMap( ctx context.Context, q string, args ...interface{}, ) (map[string]interface{}, error)
QueryIntoMap will return a map[string]interface{} representation of exactly one row only. This is because you cannot have a single map object which contains data for multiple rows
func QueryIntoSlice ¶
func QueryIntoString ¶
func QueryIntoStruct ¶
func SetLoggingVerbosity ¶
func SetLoggingVerbosity(level int)
Logging verbosity level, from 0 (nothing) upwards.
func StringFlag ¶
Types ¶
type LoggerStatsType ¶
type NullPgJson ¶
func (*NullPgJson) Scan ¶
func (p *NullPgJson) Scan(src interface{}) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.