Documentation ¶
Index ¶
- Constants
- type BandwidthQuantity
- func (q *BandwidthQuantity) Bytes() int64
- func (q *BandwidthQuantity) Equal(u *BandwidthQuantity) bool
- func (q *BandwidthQuantity) MarshalJSON() ([]byte, error)
- func (q *BandwidthQuantity) String() string
- func (q *BandwidthQuantity) UnmarshalJSON(b []byte) error
- func (q *BandwidthQuantity) UnmarshalString(s string) error
- type PortsRange
- type PortsRangeSlice
Constants ¶
View Source
const ( MB = 1024 * 1024 KB = 1024 BandwidthLimitModeClient = "client" BandwidthLimitModeServer = "server" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthQuantity ¶
type BandwidthQuantity struct {
// contains filtered or unexported fields
}
func MustBandwidthQuantity ¶
func MustBandwidthQuantity(s string) BandwidthQuantity
func NewBandwidthQuantity ¶
func NewBandwidthQuantity(s string) (BandwidthQuantity, error)
func (*BandwidthQuantity) Bytes ¶
func (q *BandwidthQuantity) Bytes() int64
func (*BandwidthQuantity) Equal ¶
func (q *BandwidthQuantity) Equal(u *BandwidthQuantity) bool
func (*BandwidthQuantity) MarshalJSON ¶
func (q *BandwidthQuantity) MarshalJSON() ([]byte, error)
func (*BandwidthQuantity) String ¶
func (q *BandwidthQuantity) String() string
func (*BandwidthQuantity) UnmarshalJSON ¶
func (q *BandwidthQuantity) UnmarshalJSON(b []byte) error
func (*BandwidthQuantity) UnmarshalString ¶
func (q *BandwidthQuantity) UnmarshalString(s string) error
type PortsRange ¶
type PortsRange struct { Start int `json:"start,omitempty"` End int `json:"end,omitempty"` Single int `json:"single,omitempty"` }
func NewPortsRangeSliceFromString ¶
func NewPortsRangeSliceFromString(str string) ([]PortsRange, error)
the format of str is like "1000-2000,3000,4000-5000"
type PortsRangeSlice ¶
type PortsRangeSlice []PortsRange
func (PortsRangeSlice) String ¶
func (p PortsRangeSlice) String() string
Click to show internal directories.
Click to hide internal directories.