feature/ip优化
This commit is contained in:
13
ip_tool/ip_cache.go
Normal file
13
ip_tool/ip_cache.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package ip_tool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Cache 定义缓存接口,遵循接口隔离原则
|
||||
type ICacheAdapter interface {
|
||||
Set(ctx context.Context, ip string, info ApiResult, ttl time.Duration) error
|
||||
Get(ctx context.Context, ip string) (*ApiResult, error)
|
||||
Exists(ctx context.Context, ip string) (bool, error)
|
||||
}
|
Reference in New Issue
Block a user