flags

package
v0.105.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fixed8FromContext

func Fixed8FromContext(ctx *cli.Context, name string) fixedn.Fixed8

Fixed8FromContext returns a parsed util.Fixed8 value provided flag name.

func ParseAddress added in v0.94.0

func ParseAddress(s string) (util.Uint160, error)

ParseAddress parses a Uint160 from either an LE string or an address.

Types

type Address

type Address struct {
	IsSet bool
	Value util.Uint160
}

Address is a wrapper for a Uint160 with flag.Value methods.

func (*Address) Set

func (a *Address) Set(s string) error

Set implements the flag.Value interface.

func (Address) String

func (a Address) String() string

String implements the fmt.Stringer interface.

func (*Address) Uint160

func (a *Address) Uint160() (u util.Uint160)

Uint160 casts an address to Uint160.

type AddressFlag

type AddressFlag struct {
	Name  string
	Usage string
	Value Address
}

AddressFlag is a flag with type string.

func (AddressFlag) Apply

func (f AddressFlag) Apply(set *flag.FlagSet)

Apply populates the flag given the flag set and environment. Ignores errors.

func (AddressFlag) GetName

func (f AddressFlag) GetName() string

GetName returns the name of the flag.

func (AddressFlag) IsSet

func (f AddressFlag) IsSet() bool

IsSet checks if flag was set to a non-default value.

func (AddressFlag) String

func (f AddressFlag) String() string

String returns a readable representation of this value (for usage defaults).

type Fixed8

type Fixed8 struct {
	Value fixedn.Fixed8
}

Fixed8 is a wrapper for a Uint160 with flag.Value methods.

func (*Fixed8) Fixed8

func (a *Fixed8) Fixed8() fixedn.Fixed8

Fixed8 casts the address to util.Fixed8.

func (*Fixed8) Set

func (a *Fixed8) Set(s string) error

Set implements the flag.Value interface.

func (Fixed8) String

func (a Fixed8) String() string

String implements the fmt.Stringer interface.

type Fixed8Flag

type Fixed8Flag struct {
	Name  string
	Usage string
	Value Fixed8
}

Fixed8Flag is a flag with type string.

func (Fixed8Flag) Apply

func (f Fixed8Flag) Apply(set *flag.FlagSet)

Apply populates the flag given the flag set and environment. Ignores errors.

func (Fixed8Flag) GetName

func (f Fixed8Flag) GetName() string

GetName returns the name of the flag.

func (Fixed8Flag) String

func (f Fixed8Flag) String() string

String returns a readable representation of this value (for usage defaults).

Jump to

Keyboard shortcuts

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