Skip to content

Commit

Permalink
Merge branch 'develop' into core-categories-expansion
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Rubin <jrubin@zvelo.com>
  • Loading branch information
Joshua Rubin committed Feb 28, 2018
2 parents a26d670 + f1ee3a7 commit 0f813e8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Gopkg.lock

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

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

[[constraint]]
name = "google.golang.org/grpc"
version = "1.9.2"
version = "1.10.0"

[[constraint]]
name = "zvelo.io/zmage"
version = "3.0.1"
version = "3.2.0"
Binary file added apiv1.protoset
Binary file not shown.
1 change: 1 addition & 0 deletions graphql_relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ var incomingHeaders = map[string]string{

var outgoingHeaders = map[string]string{
"zvelo-trace-id": "zvelo-trace-id",
"server-timing": "server-timing",
"content-type": "",
"trailer": "",
}
Expand Down
4 changes: 2 additions & 2 deletions internal/static/static.go

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

8 changes: 7 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func ProtoGRPCGateway(ctx context.Context) error {
return err
}

// Protoset generates .protoset files from .proto files
func Protoset(ctx context.Context) error {
_, err := zmage.Protoset("apiv1.proto")
return err
}

// Swagger generates .swagger.json files from .proto files
func ProtoSwagger(ctx context.Context) error {
files, err := zmage.ProtoSwagger()
Expand Down Expand Up @@ -79,7 +85,7 @@ func Static(ctx context.Context) error {

// Generate all necessary files
func Generate(ctx context.Context) error {
mg.CtxDeps(ctx, CheckImports, ProtoGo, ProtoPython, ProtoGRPCGateway, ProtoSwagger, Static)
mg.CtxDeps(ctx, CheckImports, ProtoGo, ProtoPython, ProtoGRPCGateway, ProtoSwagger, Protoset, Static)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion mock/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func parseOpts(ctx context.Context, url string, content bool, ds []msg.DataSetTy
}

for _, t := range ds {
switch msg.DataSetType(t) {
switch t {
case msg.CATEGORIZATION:
if r.ResponseDataset == nil {
r.ResponseDataset = &msg.DataSet{}
Expand Down
7 changes: 7 additions & 0 deletions status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,10 @@ func FromError(err error) (s *Status, ok bool) {

return New(st.Code(), st.Message()), true
}

// Convert is a convenience function which removes the need to handle the
// boolean return value from FromError.
func Convert(err error) *Status {
s, _ := FromError(err)
return s
}

0 comments on commit 0f813e8

Please sign in to comment.