utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP(c ipIntf) net.IP

GetIP get ip address

func GetMac

func GetMac(ip net.IP) string

GetMac get mac address

func Recover

func Recover(key string)

Recover error recover

Types

type Bytes

type Bytes uint64

Bytes custom bytes struct

func (*Bytes) Bytes

func (data *Bytes) Bytes() uint64

Bytes get bytes data

func (Bytes) MarshalJSON

func (data Bytes) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes by json

func (*Bytes) MarshalKV

func (data *Bytes) MarshalKV() (string, error)

MarshalKV marshal bytes by kv

func (Bytes) MarshalYAML

func (data Bytes) MarshalYAML() (interface{}, error)

MarshalYAML marshal bytes by yaml

func (Bytes) String

func (data Bytes) String() string

String format to string

func (*Bytes) UnmarshalJSON

func (data *Bytes) UnmarshalJSON(value []byte) error

UnmarshalJSON unmarshal bytes by json

func (*Bytes) UnmarshalKV

func (data *Bytes) UnmarshalKV(value string) error

UnmarshalKV unmarshal bytes by kv

func (*Bytes) UnmarshalYAML

func (data *Bytes) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML unmarshal bytes by yaml

type Duration

type Duration time.Duration

Duration custom duration struct

func (Duration) Duration

func (d Duration) Duration() time.Duration

Duration get duration

func (Duration) MarshalKV

func (d Duration) MarshalKV() (string, error)

MarshalKV marshal duration

func (Duration) String

func (d Duration) String() string

String format to string

func (*Duration) UnmarshalKV

func (d *Duration) UnmarshalKV(value string) error

UnmarshalKV unmarshal duration

Jump to

Keyboard shortcuts

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