feature/ip优化

This commit is contained in:
吕翠丽
2025-06-17 16:50:28 +08:00
parent 5574b1ba4e
commit 6d3891390f
5 changed files with 132 additions and 1 deletions

13
ip_tool/ip_cache.go Normal file
View 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)
}