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
Commits
86b34a2a
Commit
86b34a2a
authored
Mar 08, 2015
by
Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NewRequest() - export OptMap type
parent
bff7f730
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
commands/request.go
commands/request.go
+9
-9
No files found.
commands/request.go
View file @
86b34a2a
...
...
@@ -15,7 +15,7 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
type
o
ptMap
map
[
string
]
interface
{}
type
O
ptMap
map
[
string
]
interface
{}
type
Context
struct
{
// this Context is temporary. Will be replaced soon, as we get
...
...
@@ -68,9 +68,9 @@ func (c *Context) NodeWithoutConstructing() *core.IpfsNode {
type
Request
interface
{
Path
()
[]
string
Option
(
name
string
)
*
OptionValue
Options
()
o
ptMap
Options
()
O
ptMap
SetOption
(
name
string
,
val
interface
{})
SetOptions
(
opts
map
[
string
]
interface
{}
)
error
SetOptions
(
opts
OptMap
)
error
Arguments
()
[]
string
SetArguments
([]
string
)
Files
()
files
.
File
...
...
@@ -86,7 +86,7 @@ type Request interface {
type
request
struct
{
path
[]
string
options
o
ptMap
options
O
ptMap
arguments
[]
string
files
files
.
File
cmd
*
Command
...
...
@@ -122,8 +122,8 @@ func (r *request) Option(name string) *OptionValue {
}
// Options returns a copy of the option map
func
(
r
*
request
)
Options
()
o
ptMap
{
output
:=
make
(
o
ptMap
)
func
(
r
*
request
)
Options
()
O
ptMap
{
output
:=
make
(
O
ptMap
)
for
k
,
v
:=
range
r
.
options
{
output
[
k
]
=
v
}
...
...
@@ -151,7 +151,7 @@ func (r *request) SetOption(name string, val interface{}) {
}
// SetOptions sets the option values, unsetting any values that were previously set
func
(
r
*
request
)
SetOptions
(
opts
map
[
string
]
interface
{}
)
error
{
func
(
r
*
request
)
SetOptions
(
opts
OptMap
)
error
{
r
.
options
=
opts
return
r
.
ConvertOptions
()
}
...
...
@@ -273,12 +273,12 @@ func NewEmptyRequest() (Request, error) {
// NewRequest returns a request initialized with given arguments
// An non-nil error will be returned if the provided option values are invalid
func
NewRequest
(
path
[]
string
,
opts
o
ptMap
,
args
[]
string
,
file
files
.
File
,
cmd
*
Command
,
optDefs
map
[
string
]
Option
)
(
Request
,
error
)
{
func
NewRequest
(
path
[]
string
,
opts
O
ptMap
,
args
[]
string
,
file
files
.
File
,
cmd
*
Command
,
optDefs
map
[
string
]
Option
)
(
Request
,
error
)
{
if
path
==
nil
{
path
=
make
([]
string
,
0
)
}
if
opts
==
nil
{
opts
=
make
(
map
[
string
]
interface
{}
)
opts
=
make
(
OptMap
)
}
if
args
==
nil
{
args
=
make
([]
string
,
0
)
...
...
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