mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 19:24:14 +08:00
commands: Created Option struct
This commit is contained in:

committed by
Juan Batiz-Benet

parent
dd2a10509f
commit
30ea427b7b
20
commands/option.go
Normal file
20
commands/option.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package commands
|
||||||
|
|
||||||
|
import "reflect"
|
||||||
|
|
||||||
|
const (
|
||||||
|
Invalid = reflect.Invalid
|
||||||
|
Bool = reflect.Bool
|
||||||
|
Int = reflect.Int
|
||||||
|
Uint = reflect.Uint
|
||||||
|
Float = reflect.Float32
|
||||||
|
String = reflect.String
|
||||||
|
)
|
||||||
|
|
||||||
|
// Option is used to specify a field that will be provided by a consumer
|
||||||
|
type Option struct {
|
||||||
|
Names []string // a list of unique names to
|
||||||
|
Type reflect.Kind // value must be this type
|
||||||
|
//Default interface{} // the default value (ignored if `Required` is true)
|
||||||
|
//Required bool // whether or not the option must be provided
|
||||||
|
}
|
Reference in New Issue
Block a user