🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/zhengchengdong/arp4g-redis

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/zhengchengdong/arp4g-redis

v0.0.0-20221114095443-addcf8399d38
Source
Go
Version published
Created
Source

ARP4G-redis

这是ARP4G的Redis实现。

功能

  • 实现基于Redis的持久化
  • 实现基于redsync的互斥锁

如何使用

//定义仓库
type OrderRepository interface {
	Take(ctx context.Context, id any) (order *Order, found bool)
}
//定义Service
type OrderService struct {
	orderRepository OrderRepository
}
//获得redis客户端
redisClient := redis.NewClient(&redis.Options{
	Addr: "127.0.0.1:6379",
	DB:   0,
})
//生成仓库的redis实现
redisOrderRepo := redisrepo.NewRedisRepository(redisClient, "Order", func() *aggregate.MySession { return &Order{} })
//使用仓库生成Service
orderService := &OrderService{redisOrderRepo}

FAQs

Package last updated on 14 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts