mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
commands: Added Request#SetOptions
This commit is contained in:
parent
57c48adfcf
commit
c19bdf18b2
@ -61,6 +61,7 @@ type Request interface {
|
||||
Option(name string) *OptionValue
|
||||
Options() optMap
|
||||
SetOption(name string, val interface{})
|
||||
SetOptions(opts map[string]interface{}) error
|
||||
Arguments() []string
|
||||
SetArguments([]string)
|
||||
Files() File
|
||||
@ -144,6 +145,12 @@ func (r *request) SetOption(name string, val interface{}) {
|
||||
r.options[name] = val
|
||||
}
|
||||
|
||||
// SetOptions sets the option values, unsetting any values that were previously set
|
||||
func (r *request) SetOptions(opts map[string]interface{}) error {
|
||||
r.options = opts
|
||||
return r.ConvertOptions()
|
||||
}
|
||||
|
||||
// Arguments returns the arguments slice
|
||||
func (r *request) Arguments() []string {
|
||||
return r.arguments
|
||||
|
||||
Loading…
Reference in New Issue
Block a user