Documentation ¶
Index ¶
- Constants
- Variables
- type Mongo
- type Redis
- func (r Redis) Cache(key string, callback func(...any) any, args ...any) any
- func (r Redis) Close()
- func (r Redis) Delete(keys ...string) int64
- func (r Redis) Get(key string) any
- func (r Redis) Scan(key string) []string
- func (r Redis) Set(key string, data any) bool
- func (r Redis) SetWithExp(key string, data any, exp time.Duration) bool
Constants ¶
View Source
const ( MongoURL = "mongodb://mongo:mongo@127.0.0.1:27017" MongoDatabase = "app" MongoTimeout = 1 * time.Second )
Variables ¶
View Source
var ( RedisURL = "redis://127.0.0.1:6379/0" RedisExp = 5 * time.Minute )
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
func NewMongoWithURL ¶
func (Mongo) Collection ¶
func (m Mongo) Collection(collection string) *mongo.Collection
type Redis ¶
func NewRedisWithURL ¶
Click to show internal directories.
Click to hide internal directories.