remote

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRedisClient

func InitRedisClient(addr string, port int, userName string, password string, useTls bool) (redisClient *redis.ClusterClient, err error)

func Redis_Get

func Redis_Get(ctx context.Context, Redis *redis.ClusterClient, keystr string) (*data.GeoInfo, error)

Types

type IpData

type IpData struct {
	// contains filtered or unexported fields
}

func (*IpData) GetRemoteInfo

func (i *IpData) GetRemoteInfo(ip string) (*data.GeoInfo, error)

func (*IpData) SaveToCache

func (i *IpData) SaveToCache(ip_date *data.GeoInfo, duration time.Duration)

type IpGeoRemote

type IpGeoRemote interface {
	GetRemoteInfo(ip string) (*data.GeoInfo, error)
	SaveToCache(ip_date *data.GeoInfo, duration time.Duration)
}

func NewIpData

func NewIpData(ipDataAccessKey string,

	redisConfig RedisConfig,
	logger log.Logger,

) (IpGeoRemote, error)

type RedisConfig

type RedisConfig struct {
	Addr     string
	Port     int
	UserName string
	Password string
	Prefix   string
	UseTLS   bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL