libraries

package
v0.0.0-...-0067e36 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX_REDIS = "news_api:"

Variables

This section is empty.

Functions

func AwsUploadS3

func AwsUploadS3(img string, path string) error

func CheckError

func CheckError(err error)

func ClaimToken

func ClaimToken(username string) (string, error)

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, m string, code int)

func InArray

func InArray(val interface{}, array interface{}) (exists bool, index int)

func OpenQueue

func OpenQueue(key string) rmq.Queue

func Pagination

func Pagination(limit int, page int) int

func RandomString

func RandomString(n int) string

func RedisDelete

func RedisDelete(key string) (bool, error)

func RedisDeletePrefix

func RedisDeletePrefix(prefix string) error

func RedisExists

func RedisExists(key string) bool

func RedisFlushAll

func RedisFlushAll() error

func RedisGet

func RedisGet(key string) ([]byte, error)

func RedisHashExists

func RedisHashExists(key string, field string) bool

func RedisHashGet

func RedisHashGet(key string, field string) (string, error)

func RedisHashSet

func RedisHashSet(key string, field string, val interface{}) error

func RedisSet

func RedisSet(key string, val interface{}, duration time.Duration) error

func SetData

func SetData(w http.ResponseWriter, data interface{}, code int)

func ValidateToken

func ValidateToken(myToken string) (bool, string)

Types

type MyCustomClaims

type MyCustomClaims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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