Documentation ¶
Index ¶
- Constants
- func AwsUploadS3(img string, path string) error
- func CheckError(err error)
- func ClaimToken(username string) (string, error)
- func ErrorResponse(w http.ResponseWriter, m string, code int)
- func InArray(val interface{}, array interface{}) (exists bool, index int)
- func OpenQueue(key string) rmq.Queue
- func Pagination(limit int, page int) int
- func RandomString(n int) string
- func RedisDelete(key string) (bool, error)
- func RedisDeletePrefix(prefix string) error
- func RedisExists(key string) bool
- func RedisFlushAll() error
- func RedisGet(key string) ([]byte, error)
- func RedisHashExists(key string, field string) bool
- func RedisHashGet(key string, field string) (string, error)
- func RedisHashSet(key string, field string, val interface{}) error
- func RedisSet(key string, val interface{}, duration time.Duration) error
- func SetData(w http.ResponseWriter, data interface{}, code int)
- func ValidateToken(myToken string) (bool, string)
- type MyCustomClaims
Constants ¶
View Source
const PREFIX_REDIS = "news_api:"
Variables ¶
This section is empty.
Functions ¶
func AwsUploadS3 ¶
func CheckError ¶
func CheckError(err error)
func ClaimToken ¶
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, m string, code int)
func Pagination ¶
func RandomString ¶
func RedisDelete ¶
func RedisDeletePrefix ¶
func RedisExists ¶
func RedisFlushAll ¶
func RedisFlushAll() error
func RedisHashExists ¶
func RedisHashSet ¶
func SetData ¶
func SetData(w http.ResponseWriter, data interface{}, code int)
func ValidateToken ¶
Types ¶
type MyCustomClaims ¶
type MyCustomClaims struct { Username string `json:"username"` jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.