capacity

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Byte     Capacities = 1
	Kilobyte            = Byte << 10
	Megabyte            = Kilobyte << 10
	Gigabyte            = Megabyte << 10
	Terabyte            = Gigabyte << 10
)

Variables

This section is empty.

Functions

func StringToCapacityHookFunc

func StringToCapacityHookFunc() func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

StringToCapacityHookFunc Implementation mapstructure.DecodeHookFunc

Types

type Capacities

type Capacities int64

func ParseCapacities

func ParseCapacities(s string) (Capacities, error)

func (Capacities) MarshalJSON

func (c Capacities) MarshalJSON() ([]byte, error)

func (Capacities) MarshalYAML

func (c Capacities) MarshalYAML() (interface{}, error)

func (*Capacities) Set

func (c *Capacities) Set(s string) error

Set

@Description[en-US]: Implement the Set method in the Value interface of `spf13/pflag`
@Description[zh-CN]: 实现spf13/pflag的Value接口中的Set方法
@param s 	string
@return error

func (*Capacities) String

func (c *Capacities) String() string

String

	@Description[en-US]: Implement the String method in the Value interface of `spf13/pflag`
	@Description[zh-CN]: 实现spf13/pflag的Value接口中的String方法
 @return string

func (*Capacities) Type

func (c *Capacities) Type() string

Type

@Description[en-US]: Implement the Type method in the Value interface of `spf13/pflag`
@Description[zh-CN]: 实现spf13/pflag的Value接口中的Type方法
@return string

func (*Capacities) UnmarshalJSON

func (c *Capacities) UnmarshalJSON(b []byte) error

func (*Capacities) UnmarshalYAML

func (c *Capacities) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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