commons

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IpFromHostname

func IpFromHostname(enableIpV6 bool) (ip string, err error)

IpFromHostname 通过host获取ip列表中的第一个

func ParseTime

func ParseTime(value string) (result time.Time, err error)

func ValidateFieldMessage

func ValidateFieldMessage(_type reflect.Type, exp string) (key string, msg string)

func ValidateRegisterRegex

func ValidateRegisterRegex(validate *validator.Validate)

Types

type Keyable added in v0.1.1

type Keyable interface {
	Key() (key string)
}

type Ring added in v0.1.1

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

func NewRing added in v0.1.1

func NewRing(values ...Keyable) (r *Ring)

func (*Ring) Append added in v0.1.1

func (r *Ring) Append(v Keyable)

func (*Ring) Next added in v0.1.1

func (r *Ring) Next() (value Keyable)

func (*Ring) Remove added in v0.1.1

func (r *Ring) Remove(v Keyable)

func (*Ring) Size added in v0.1.1

func (r *Ring) Size() (size int)

func (*Ring) String added in v0.1.1

func (r *Ring) String() (value string)

type RingEntry added in v0.1.1

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

type Wildcard

type Wildcard struct {
	Prefix string
	Suffix string
}

func (Wildcard) Match

func (w Wildcard) Match(s string) bool

Jump to

Keyboard shortcuts

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