Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIP = errors.New("invalid IP address")
Functions ¶
func IpRangeToCIDR ¶
IpRangeToCIDR both side inclusive
func IpToUint32 ¶
func Uint32ToIP ¶
Types ¶
type ResolverArray ¶
type ResolverArray struct {
// contains filtered or unexported fields
}
ResolverArray is a wrapper type for gomobile compatibility. ResolverArray is not protected by lock and should not be read and write at the same time.
func NewResolverArray ¶
func NewResolverArray(elems ...Resolver) *ResolverArray
NewResolverArray creates a ResolverArray from a list of string elements.
func NewResolverArrayFromResolver ¶
func NewResolverArrayFromResolver(e Resolver) *ResolverArray
NewResolverArrayFromResolver creates a ResolverArray from a single string input. The input string will be split to string array by whitespace.
func (*ResolverArray) Append ¶
func (ia *ResolverArray) Append(a Resolver)
Append adds an element to the string array.
func (*ResolverArray) Elems ¶
func (ia *ResolverArray) Elems() []Resolver
Elems returns the string array elements.
func (*ResolverArray) Get ¶
func (ia *ResolverArray) Get(i int) Resolver
Get gets an element to the string array.
func (*ResolverArray) RandomElem ¶
func (ia *ResolverArray) RandomElem() Resolver
RandomElem returns a randome element from the string array. The random number is generated using math/rand and thus not cryptographically secure.
type StringArray ¶
type StringArray struct {
// contains filtered or unexported fields
}
StringArray is a wrapper type for gomobile compatibility. StringArray is not protected by lock and should not be read and write at the same time.
func ExcludeRoute ¶
func ExcludeRoute(ipArray *StringArray) *StringArray
func NewStringArray ¶
func NewStringArray(elems ...string) *StringArray
NewStringArray creates a StringArray from a list of string elements.
func NewStringArrayFromString ¶
func NewStringArrayFromString(s string) *StringArray
NewStringArrayFromString creates a StringArray from a single string input. The input string will be split to string array by whitespace.
func (*StringArray) Append ¶
func (sa *StringArray) Append(s string)
Append adds an element to the string array.
func (*StringArray) Elems ¶
func (sa *StringArray) Elems() []string
Elems returns the string array elements.
func (*StringArray) Get ¶
func (sa *StringArray) Get(i int) string
Get gets an element to the string array.
func (*StringArray) GetJson ¶
func (sa *StringArray) GetJson() string
func (*StringArray) Join ¶
func (sa *StringArray) Join(separator string) string
Join returns a single string by concatenates the elements
func (*StringArray) RandomElem ¶
func (sa *StringArray) RandomElem() string
RandomElem returns a randome element from the string array. The random number is generated using math/rand and thus not cryptographically secure.
type StringMap ¶
type StringMap struct {
// contains filtered or unexported fields
}
StringMap is a wrapper type for gomobile compatibility. StringMap is not protected by lock and should not be read and write at the same time.
func NewStringMap ¶
NewStringMap creates a StringMap from a map.
func NewStringMapWithSize ¶
NewStringMapWithSize creates an empty StringMap with a given size.
func (*StringMap) Range ¶
func (sm *StringMap) Range(cb StringMapFunc)
Range iterates over the StringMap and call the OnVisit callback function with each element in the map. If the OnVisit function returns false, the iterator will stop and no longer visit the rest elements.
type StringMapFunc ¶
StringMapFunc is a wrapper type for gomobile compatibility.