Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
2de5989e
Commit
2de5989e
authored
6 years ago
by
Alex Dadgar
Browse files
Options
Download
Email Patches
Plain Diff
vet
parent
1736d934
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
plugins/base/plugin.go
+4
-1
plugins/base/plugin.go
plugins/base/plugin_test.go
+7
-7
plugins/base/plugin_test.go
plugins/shared/hclspec/dec.go
+0
-2
plugins/shared/hclspec/dec.go
plugins/shared/hclspec/dec_test.go
+5
-5
plugins/shared/hclspec/dec_test.go
with
16 additions
and
15 deletions
+16
-15
plugins/base/plugin.go
+
4
-
1
View file @
2de5989e
...
...
@@ -33,7 +33,10 @@ type PluginBase struct {
}
func
(
p
*
PluginBase
)
GRPCServer
(
broker
*
plugin
.
GRPCBroker
,
s
*
grpc
.
Server
)
error
{
proto
.
RegisterBasePluginServer
(
s
,
&
basePluginServer
{
impl
:
p
.
impl
})
proto
.
RegisterBasePluginServer
(
s
,
&
basePluginServer
{
impl
:
p
.
impl
,
broker
:
broker
,
})
return
nil
}
...
...
This diff is collapsed.
Click to expand it.
plugins/base/plugin_test.go
+
7
-
7
View file @
2de5989e
...
...
@@ -16,27 +16,27 @@ var (
// testSpec is an hcl Spec for testing
testSpec
=
&
hclspec
.
Spec
{
Block
:
&
hclspec
.
Spec_Object
{
&
hclspec
.
Object
{
Object
:
&
hclspec
.
Object
{
Attributes
:
map
[
string
]
*
hclspec
.
Spec
{
"foo"
:
&
hclspec
.
Spec
{
"foo"
:
{
Block
:
&
hclspec
.
Spec_Attr
{
&
hclspec
.
Attr
{
Attr
:
&
hclspec
.
Attr
{
Type
:
"string"
,
Required
:
false
,
},
},
},
"bar"
:
&
hclspec
.
Spec
{
"bar"
:
{
Block
:
&
hclspec
.
Spec_Attr
{
&
hclspec
.
Attr
{
Attr
:
&
hclspec
.
Attr
{
Type
:
"number"
,
Required
:
true
,
},
},
},
"baz"
:
&
hclspec
.
Spec
{
"baz"
:
{
Block
:
&
hclspec
.
Spec_Attr
{
&
hclspec
.
Attr
{
Attr
:
&
hclspec
.
Attr
{
Type
:
"bool"
,
},
},
...
...
This diff is collapsed.
Click to expand it.
plugins/shared/hclspec/dec.go
+
0
-
2
View file @
2de5989e
...
...
@@ -82,8 +82,6 @@ func decodeSpecBlock(spec *Spec, impliedName string) (hcldec.Spec, hcl.Diagnosti
})
return
nil
,
diags
}
return
nil
,
nil
}
func
decodeObjectSpec
(
obj
*
Object
)
(
hcldec
.
Spec
,
hcl
.
Diagnostics
)
{
...
...
This diff is collapsed.
Click to expand it.
plugins/shared/hclspec/dec_test.go
+
5
-
5
View file @
2de5989e
...
...
@@ -46,7 +46,7 @@ func TestDec_Convert_Object(t *testing.T) {
Block
:
&
Spec_Object
{
&
Object
{
Attributes
:
map
[
string
]
*
Spec
{
"foo"
:
&
Spec
{
"foo"
:
{
Block
:
&
Spec_Attr
{
&
Attr
{
Type
:
"string"
,
...
...
@@ -54,7 +54,7 @@ func TestDec_Convert_Object(t *testing.T) {
},
},
},
"bar"
:
&
Spec
{
"bar"
:
{
Block
:
&
Spec_Attr
{
&
Attr
{
Type
:
"number"
,
...
...
@@ -62,7 +62,7 @@ func TestDec_Convert_Object(t *testing.T) {
},
},
},
"baz"
:
&
Spec
{
"baz"
:
{
Block
:
&
Spec_Attr
{
&
Attr
{
Type
:
"bool"
,
...
...
@@ -106,7 +106,7 @@ func TestDec_Convert_Array(t *testing.T) {
Block
:
&
Spec_Array
{
Array
:
&
Array
{
Values
:
[]
*
Spec
{
&
Spec
{
{
Block
:
&
Spec_Attr
{
&
Attr
{
Name
:
"foo"
,
...
...
@@ -115,7 +115,7 @@ func TestDec_Convert_Array(t *testing.T) {
},
},
},
&
Spec
{
{
Block
:
&
Spec_Attr
{
&
Attr
{
Name
:
"bar"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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