resources

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Street   string
	Building int
}

func (*Address) MarshalFlag

func (a *Address) MarshalFlag(value string) error

type AddressCommand

type AddressCommand struct {
	Address Address `flag:"addr,required" short:"a" description:"Address separated by comma (Example: Some street, 14)"`
}

AddressCommand with @Cobra(

usage = "cli update address",
example = "cli update address -a 'Some street, 14'",
short = "Update address command of the application (short)",
long = "Update address command of the application (long)",

)

func (AddressCommand) Run

func (c AddressCommand) Run(cmd *cobra.Command, agrs []string) error

Run - @CobraRun command

type Gender

type Gender string

func (*Gender) MarshalFlag

func (g *Gender) MarshalFlag(value string) error

type State

type State int

func (*State) MarshalFlag

func (s *State) MarshalFlag(value string) error

type UserCommand

type UserCommand struct {
	Gender    Gender  `flag:"gender,required" short:"g" description:"User gender, one of: male, female"`
	FirstName string  `flag:"name,required" short:"n" description:"User name"`
	LastName  string  `flag:"lastname" short:"l" description:"User last name"`
	State     State   `flag:"state,required" short:"s" description:"State is a value from 1 to 5"`
	PI        float64 `flag:"fourth,inherited"`
}

UserCommand with @Cobra(

usage = "cli update user",
example = "cli update user -g male -n John -l Doe -s 5",
short = "Get user command of the application (short)",
long = "Get user command of the application (long)",

)

func (UserCommand) Run

func (c UserCommand) Run(cmd *cobra.Command, agrs []string) error

Run - @CobraRun command

Jump to

Keyboard shortcuts

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