Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
41d0852d
Commit
41d0852d
authored
Oct 23, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Added Request#Options so consumers can iterate through provided options
parent
32a10ebc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
request.go
request.go
+10
-0
No files found.
request.go
View file @
41d0852d
...
...
@@ -13,6 +13,7 @@ type optMap map[string]interface{}
type
Request
interface
{
Path
()
[]
string
Option
(
name
string
)
(
interface
{},
bool
)
Options
()
map
[
string
]
interface
{}
SetOption
(
name
string
,
val
interface
{})
Arguments
()
[]
string
Stream
()
io
.
Reader
...
...
@@ -39,6 +40,15 @@ func (r *request) Option(name string) (interface{}, bool) {
return
val
,
err
}
// Options returns a copy of the option map
func
(
r
*
request
)
Options
()
map
[
string
]
interface
{}
{
output
:=
make
(
optMap
)
for
k
,
v
:=
range
r
.
options
{
output
[
k
]
=
v
}
return
output
}
// SetOption sets the value of the option for given name.
func
(
r
*
request
)
SetOption
(
name
string
,
val
interface
{})
{
r
.
options
[
name
]
=
val
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment