Documentation ¶
Index ¶
- Constants
- func ArrayDiffInt(a []int, b []int) []int
- func ArrayDiffInt32(a []int32, b []int32) []int32
- func ArrayDiffStr(a []string, b []string) []string
- func ArrayFillStr(value string, count int) []string
- func ArrayFilterAndJoinStr(a []string, sep string) string
- func ArrayFilterFnStr(a []string, fn func(v string) bool) []string
- func ArrayFilterStr(a []string) []string
- func ArrayIncludesInt(haystack []int, needle int) bool
- func ArrayIncludesInt32(haystack []int32, needle int32) bool
- func ArrayIncludesStr(haystack []string, needle string) bool
- func ArrayIncludesUUID(haystack []uuid.UUID, needle uuid.UUID) bool
- func ArrayMapStr(a []string, fn func(v string) string) []string
- func BoolFromSqlTinyInt(v int8) bool
- func BoolRef(v bool) *bool
- func CliAsk(question string, defaultAnswer string) string
- func CliAskPassword(question string) string
- func CliAskRequired(question string, defaultAnswer string) string
- func CliConfirm(question string) bool
- func FormatDate(t time.Time, format string) string
- func GenerateRandomKey(length int) []byte
- func GenerateRandomString(length int, charset []rune) string
- func GqlTime(v time.Time) string
- func GqlTimeRefSql(v sql.NullTime) *string
- func Int32MustParse(v string) int32
- func Int32Ref(v int32) *int32
- func Int64MustParse(v string) int64
- func Int64Ref(v int64) *int64
- func IntArray2StrArray(in []int) []string
- func IntRef(v int) *int
- func IntRefSql(v sql.NullInt32) *int
- func JoinIntArray(in []int, sep string) string
- func MigrateCommand(migrator *migrate.Migrate) *cli.Command
- func MysqlDbMigrate(db *sqlx.DB, migrations *bindata.AssetSource) (*migrate.Migrate, error)
- func NewAwsConfig(ctx context.Context, log zerolog.Logger) aws.Config
- func NewDefaultLogger() zerolog.Logger
- func OpenDb(log zerolog.Logger, driverName string, dsn string, maxOpenConns int) (*sqlx.DB, error)
- func OpenDbFromWhaleblazer(log zerolog.Logger, maxOpenConns int) (*sqlx.DB, error)
- func Plural(count int, singular string, plural string) string
- func PrintErrWithStack(err error)
- func RenderTemplatePlain(tplStr string, data interface{}) (string, error)
- func SqlNullInt32(v int32) sql.NullInt32
- func SqlNullStr(v string) sql.NullString
- func SqlNullStrRef(v *string) sql.NullString
- func SqlNullTime(v time.Time) sql.NullTime
- func SqlTimeToStrRef(v sql.NullTime) *string
- func SqlTinyIntFromBool(v bool) int8
- func StrFromRef(v *string) string
- func StrRef(v string) *string
- func StrRefSql(v sql.NullString) *string
- func StrSliceToStrRefSlice(v []string) []*string
- func TimeFromGqlTime(v string) (time.Time, error)
- func TimeRef(v time.Time) *time.Time
- func TimeRefFromGqlTimeRef(v *string) *time.Time
- func UuidRef(id uuid.UUID) *uuid.UUID
- func WhaleblazerMysqlConfig() (*mysql2.Config, error)
- type ClientError
- type ReCaptcha
- func (r ReCaptcha) PublicSettings() ReCaptchaPublicSettings
- func (r ReCaptcha) ReCaptchaV2Verify(ctx context.Context, token string) (*ReCaptchaV2Response, error)
- func (r ReCaptcha) ReCaptchaV3Verify(ctx context.Context, token string) (*ReCaptchaV3Response, error)
- func (r ReCaptcha) VerifyReCaptchaTokensFromContext(ctx context.Context, action string, tokens ReCaptchaTokens) error
- type ReCaptchaPublicSettings
- type ReCaptchaTokens
- type ReCaptchaV2Response
- type ReCaptchaV3Response
Constants ¶
View Source
const MB = 1 << 20
Variables ¶
This section is empty.
Functions ¶
func ArrayDiffInt ¶ added in v0.0.7
ArrayDiffInt returns a slice of all values from a that are not in b.
func ArrayDiffInt32 ¶ added in v0.0.2
ArrayDiffInt32 returns a slice of all values from a that are not in b.
func ArrayDiffStr ¶ added in v0.0.2
ArrayDiffStr returns a slice of all values from a that are not in b.
func ArrayFillStr ¶ added in v0.0.2
func ArrayFilterAndJoinStr ¶ added in v0.0.2
func ArrayFilterFnStr ¶ added in v0.0.2
func ArrayFilterStr ¶ added in v0.0.2
func ArrayIncludesInt ¶ added in v0.0.2
func ArrayIncludesInt32 ¶ added in v0.0.2
func ArrayIncludesStr ¶ added in v0.0.2
func ArrayIncludesUUID ¶ added in v0.0.2
func BoolFromSqlTinyInt ¶ added in v0.0.2
func CliAskPassword ¶
func CliAskRequired ¶
func CliConfirm ¶
func FormatDate ¶ added in v0.0.2
FormatDate supports ordinal days.
func GenerateRandomKey ¶ added in v0.0.2
func GenerateRandomString ¶ added in v0.0.2
func GqlTimeRefSql ¶ added in v0.0.2
func Int32MustParse ¶ added in v0.0.2
func Int64MustParse ¶ added in v0.0.2
func IntArray2StrArray ¶ added in v0.0.8
func JoinIntArray ¶ added in v0.0.8
func MigrateCommand ¶
func MigrateCommand(migrator *migrate.Migrate) *cli.Command
func MysqlDbMigrate ¶
func MysqlDbMigrate(db *sqlx.DB, migrations *bindata.AssetSource) (*migrate.Migrate, error)
func NewDefaultLogger ¶
func OpenDbFromWhaleblazer ¶ added in v0.0.21
func PrintErrWithStack ¶
func PrintErrWithStack(err error)
func RenderTemplatePlain ¶ added in v0.0.2
func SqlNullInt32 ¶ added in v0.0.2
SqlNullInt32 will return a sql 'null' value if the value is 0.
func SqlNullStr ¶ added in v0.0.2
func SqlNullStr(v string) sql.NullString
SqlNullStr will return a sql 'null' value if the string is empty.
func SqlNullStrRef ¶ added in v0.0.2
func SqlNullStrRef(v *string) sql.NullString
SqlNullStrRef will return a sql 'null' value if the string is nil.
func SqlNullTime ¶ added in v0.0.2
SqlNullTime will return a sql 'null' value if the time is 0.
func SqlTimeToStrRef ¶ added in v0.0.2
func SqlTinyIntFromBool ¶ added in v0.0.2
func StrFromRef ¶ added in v0.0.2
func StrRefSql ¶ added in v0.0.2
func StrRefSql(v sql.NullString) *string
StrRefSql will return nil for a 'null' SQL string.
func StrSliceToStrRefSlice ¶ added in v0.0.2
func TimeRefFromGqlTimeRef ¶ added in v0.0.2
func WhaleblazerMysqlConfig ¶ added in v0.0.21
Types ¶
type ClientError ¶ added in v0.0.6
type ClientError struct {
// contains filtered or unexported fields
}
ClientError represents an error that should be displayed to the user.
func NewClientError ¶ added in v0.0.6
func NewClientError(code string, message string, err error) *ClientError
func (*ClientError) Error ¶ added in v0.0.6
func (err *ClientError) Error() string
func (*ClientError) GqlErrorCode ¶ added in v0.0.6
func (err *ClientError) GqlErrorCode() string
func (*ClientError) StackTrace ¶ added in v0.0.6
func (err *ClientError) StackTrace() errors.StackTrace
func (*ClientError) Unwrap ¶ added in v0.0.6
func (err *ClientError) Unwrap() error
type ReCaptcha ¶ added in v0.0.12
type ReCaptcha struct { Log zerolog.Logger SecretKeyV2 string SiteKeyV2 string SecretKeyV3 string SiteKeyV3 string MinScoreV3 float32 }
func NewReCaptchaFromEnv ¶ added in v0.0.12
func (ReCaptcha) PublicSettings ¶ added in v0.0.14
func (r ReCaptcha) PublicSettings() ReCaptchaPublicSettings
func (ReCaptcha) ReCaptchaV2Verify ¶ added in v0.0.12
func (ReCaptcha) ReCaptchaV3Verify ¶ added in v0.0.12
func (ReCaptcha) VerifyReCaptchaTokensFromContext ¶ added in v0.0.12
type ReCaptchaPublicSettings ¶ added in v0.0.14
type ReCaptchaTokens ¶ added in v0.0.12
type ReCaptchaV2Response ¶ added in v0.0.12
Click to show internal directories.
Click to hide internal directories.