Skip to content

Commit

Permalink
remove redis support
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjianzhang committed Sep 5, 2024
1 parent 2c8bcf0 commit 90149af
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 548 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

### 功能
- [x] log组件
- [x] 缓存(支持memory、redis)
- [x] 队列(支持memory、redis)
- [x] 缓存(支持memory)
- [x] 队列(支持memory)
- [x] 日志写入writer
- [x] 日志插件logrus
- [x] 日志插件zap
Expand Down
17 changes: 1 addition & 16 deletions sdk/config/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,13 @@ import (
)

type Cache struct {
Redis *RedisConnectOptions
Memory interface{}
}

// CacheConfig cache配置
var CacheConfig = new(Cache)

// Setup 构造cache 顺序 redis > 其他 > memory
// Setup 构造cache 顺序 其他 > memory
func (e Cache) Setup() (storage.AdapterCache, error) {
if e.Redis != nil {
options, err := e.Redis.GetRedisOptions()
if err != nil {
return nil, err
}
r, err := cache.NewRedis(GetRedisClient(), options)
if err != nil {
return nil, err
}
if _redis == nil {
_redis = r.GetClient()
}
return r, nil
}
return cache.NewMemory(), nil
}
2 changes: 0 additions & 2 deletions sdk/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type Config struct {
Gen *Gen `yaml:"gen"`
Cache *Cache `yaml:"cache"`
Queue *Queue `yaml:"queue"`
Locker *Locker `yaml:"locker"`
Extend interface{} `yaml:"extend"`
}

Expand Down Expand Up @@ -80,7 +79,6 @@ func Setup(s source.Source,
Gen: GenConfig,
Cache: CacheConfig,
Queue: QueueConfig,
Locker: LockerConfig,
Extend: ExtendConfig,
},
callbacks: fs,
Expand Down
35 changes: 0 additions & 35 deletions sdk/config/locker.go

This file was deleted.

172 changes: 0 additions & 172 deletions sdk/config/option_nsq.go

This file was deleted.

90 changes: 0 additions & 90 deletions sdk/config/option_redis.go

This file was deleted.

Loading

0 comments on commit 90149af

Please sign in to comment.