utils

package
v1.68.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPublicIP added in v1.67.3

func IsPublicIP(ip string) bool

IsPublicIP ...

tcp/ip协议中,专门保留了三个IP地址区域作为私有地址,其地址范围如下: 10.0.0.0/8:10.0.0.0~10.255.255.255 172.16.0.0/12:172.16.0.0~172.31.255.255 192.168.0.0/16:192.168.0.0~192.168.255.255

func LocalIPv4s added in v1.67.3

func LocalIPv4s() ([]string, error)

LocalIPv4s ... LocalIPs return all non-loopback IPv4 addresses

Types

type SpaceLimitCache

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

SpaceLimitCache lru缓存封装, 控制占用空间大小

func NewSpaceLimitCache

func NewSpaceLimitCache(num, maxByteSize int) *SpaceLimitCache

NewSpaceLimitCache new space limit cache

func (*SpaceLimitCache) Add

func (c *SpaceLimitCache) Add(key interface{}, val interface{}, size int) bool

Add add key val

func (*SpaceLimitCache) Contains

func (c *SpaceLimitCache) Contains(key interface{}) bool

Contains check if exist

func (*SpaceLimitCache) Get

func (c *SpaceLimitCache) Get(key interface{}) interface{}

Get get key

func (*SpaceLimitCache) Remove

func (c *SpaceLimitCache) Remove(key interface{}) (interface{}, bool)

Remove remove key

Jump to

Keyboard shortcuts

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