ssgf_utils/ip_tool/ip_cache.go
2025-06-17 16:57:42 +08:00

14 lines
322 B
Go

package ip_tool
import (
"context"
"time"
)
// Cache 定义缓存接口,遵循接口隔离原则
type ICacheAdapter interface {
Set(ctx context.Context, ip string, info string, ttl time.Duration) error
Get(ctx context.Context, ip string) (*ApiResult, error)
Exists(ctx context.Context, ip string) (bool, error)
}