utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Database

func Database(fname string) (*gorm.DB, error)

func GetOrDefault

func GetOrDefault(keys map[string]interface{}, key, def string) (string, bool)

func GetRedisClient

func GetRedisClient(addr string) *redis.Client

GetRedisClient returns a *redis.Client instance

func MarshalIntoRedis

func MarshalIntoRedis(f interface{}, r *redis.Client, key string) error

MarshalIntoRedis marshals a type interface{} into a redis data

func PanfromMobile

func PanfromMobile(username string, r *redis.Client) (string, bool)

func SaveRedisList

func SaveRedisList(r *redis.Client, key string, value interface{}) error

SaveRedisList saves to a list in redis

func SendSMS

func SendSMS(noebsConfig *ebs_fields.NoebsConfig, sms SMS) error

SendSMS a generic function to send sms to any user

func StringsToBytes

func StringsToBytes(s []string) (bytes.Buffer, error)

Types

type SMS

type SMS struct {
	Mobile  string `json:"mobile,omitempty"`
	Message string `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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