Skip to content

Commit

Permalink
update to latest gloo api
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Weiss <[email protected]>
  • Loading branch information
ilackarms committed Jul 17, 2018
1 parent 99fec0e commit 4ea9add
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
18 changes: 12 additions & 6 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
name = "github.com/Azure/go-autorest"
revision = "e14a70c556c8e0db173358d1a903dca345a8e75e"

[[constraint]]
name = "github.com/solo-io/gloo"
revision = "4f06039f2a3cf4ae684de8e854c5eefb6448177a"

[[constraint]]
name = "github.com/onsi/ginkgo"
version = "1.5.0"
Expand Down
21 changes: 11 additions & 10 deletions pkg/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/solo-io/qloo/pkg/bootstrap"
. "github.com/solo-io/qloo/pkg/core"
"github.com/solo-io/qloo/test"
"github.com/gogo/protobuf/types"
)

var qlooPort int
Expand Down Expand Up @@ -116,16 +117,16 @@ func eventuallyQueryShouldRespond(queryString, expectedString string) {
}, time.Second*45).Should(ContainSubstring(expectedString))
}

func ptr(str string) *string {
return &str
func ptr(str string) *types.StringValue {
return &types.StringValue{Value: str}
}

func starWarsUpstream() *gloov1.Upstream {
return &gloov1.Upstream{
Name: "starwars-rest",
Type: static.UpstreamTypeService,
Spec: static.EncodeUpstreamSpec(static.UpstreamSpec{
Hosts: []static.Host{
Spec: static.EncodeUpstreamSpec(&static.UpstreamSpec{
Hosts: []*static.Host{
{
Addr: "localhost",
Port: starWarsPort,
Expand All @@ -138,16 +139,16 @@ func starWarsUpstream() *gloov1.Upstream {
Functions: []*gloov1.Function{
{
Name: "GetHero",
Spec: rest.EncodeFunctionSpec(rest.Template{
Header: map[string]string{":method": "GET"},
Spec: rest.EncodeFunctionSpec(rest.TransformationSpec{
Headers: map[string]string{":method": "GET"},
Path: "/api/hero",
}),
},
{
Name: "GetCharacter",
Spec: rest.EncodeFunctionSpec(rest.Template{
Spec: rest.EncodeFunctionSpec(rest.TransformationSpec{
Body: ptr(""),
Header: map[string]string{
Headers: map[string]string{
"x-id": "{{id}}",
":method": "GET",
},
Expand All @@ -156,8 +157,8 @@ func starWarsUpstream() *gloov1.Upstream {
},
{
Name: "GetCharacters",
Spec: rest.EncodeFunctionSpec(rest.Template{
Header: map[string]string{
Spec: rest.EncodeFunctionSpec(rest.TransformationSpec{
Headers: map[string]string{
":method": "POST",
},
Path: "/api/characters",
Expand Down

0 comments on commit 4ea9add

Please sign in to comment.