v1.5.3 Latest Latest

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 36 Imported by: 18




This section is empty.


View Source
var MAGNITUDE_MAPS = map[int]map[int]string{
	0: {
		1: "א",
		2: "ב",
		3: "ג",
		4: "ד",
		5: "ה",
		6: "ו",
		7: "ז",
		8: "ח",
		9: "ט",
	1: {
		1: "י",
		2: "כ",
		3: "ל",
		4: "מ",
		5: "נ",
		6: "ס",
		7: "ע",
		8: "פ",
		9: "צ",
	2: {
		1: "ק",
		2: "ר",
		3: "ש",
		4: "ת",
		5: "תק",
		6: "תר",
		7: "תש",
		8: "תת",
		9: "תתק",
	3: {
		1: "א'",
		2: "ב'",
		3: "ג'",
		4: "ד'",
		5: "ה'",
		6: "ו'",
		7: "ז'",
		8: "ח'",
		9: "ט'",
View Source
var SHA1_RE = regexp.MustCompile("^[0-9a-f]{40}$")
View Source
var UID_REGEX = regexp.MustCompile("[a-zA-z0-9]{8}")


func BindErrorMessage

func BindErrorMessage(err error) string

func ConvertArgsBytes

func ConvertArgsBytes(args [][]byte) []interface{}

func ConvertArgsInt

func ConvertArgsInt(args ...int) []interface{}

func ConvertArgsInt64

func ConvertArgsInt64(args []int64) []interface{}

func ConvertArgsString

func ConvertArgsString(args []string) []interface{}

func DownloadUrl

func DownloadUrl(url string, path string) error

func EnvMiddleware

func EnvMiddleware(mdb *sql.DB, emitter events.EventEmitter, enforcer *casbin.Enforcer,
	tokenVerifiers []*oidc.IDTokenVerifier) gin.HandlerFunc

func ErrorHandlingMiddleware

func ErrorHandlingMiddleware() gin.HandlerFunc

func ErrorsToRollbarStack

func ErrorsToRollbarStack(st StackTracer) rollbar.Stack

Convert errors.StackTrace to rollbar.Stack

func GenerateName

func GenerateName(n int) string

func GenerateUID

func GenerateUID(n int) string

func HttpPostJson

func HttpPostJson(url string, payload interface{}) (*http.Response, error)

Send http POST request. Note that json encoding errors are ignored. We expect a valid payload based on https://www.zupzup.org/io-pipe-go/

func IsEmpty

func IsEmpty(s []string) bool

true if every string in given slice is empty

func MdbLoggerMiddleware

func MdbLoggerMiddleware() gin.HandlerFunc

func Min

func Min(x, y int) int

Like math.Min for int

func Must

func Must(err error)

panic if err != nil. dumps a stack trace to stderr if err satisfies StackTracer

func NumToHebrew

func NumToHebrew(num uint16) string

func ParseCSVHeader

func ParseCSVHeader(header []string) (map[string]int, error)

func RandomSHA1

func RandomSHA1() string

func ReadCSV

func ReadCSV(path string) ([][]string, error)

func RecoveryMiddleware

func RecoveryMiddleware() gin.HandlerFunc

Recover with error

func Reverse

func Reverse(s string) string

Taken AS IS from https://stackoverflow.com/a/34521190 Note that this implementation DOES NOT handle combining marks correctly

func Sha1

func Sha1(s string) string

func ValidationErrorMessage

func ValidationErrorMessage(e *validator.FieldError) string


type ContextProvider added in v0.9.5

type ContextProvider interface {
	Get(key string) (interface{}, bool)
	MustGet(key string) interface{}

type FileName

type FileName struct {
	Name     string
	Base     string
	Type     string // File extension, mp3 or mp4 or other.
	Language string
	Rav      bool
	Part     string
	Date     time.Time
	DateStr  string

func ParseFileName

func ParseFileName(name string) (*FileName, error)

type StackTracer

type StackTracer interface {
	StackTrace() errors.StackTrace

type TestDBManager

type TestDBManager struct {
	DB *sql.DB
	// contains filtered or unexported fields

func (*TestDBManager) DestroyTestDB

func (m *TestDBManager) DestroyTestDB() error

func (*TestDBManager) InitTestDB

func (m *TestDBManager) InitTestDB() error

Jump to

Keyboard shortcuts

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