From aa9d9b9ff15193580feb669cf4eb6dfbe16bc7bb Mon Sep 17 00:00:00 2001 From: Adam DeHovitz Date: Wed, 17 Mar 2021 15:46:59 -0400 Subject: [PATCH] Improvement: support optional binary (#191) `optional` now represented in go as `*ReadCloser` and a 204 status code is treated as nil --- changelog/@unreleased/pr-191.v2.yml | 10 +++ conjure/conjure_test.go | 43 +++++++++++++ conjure/serverwriter.go | 37 ++++++++++- conjure/servicewriter.go | 55 ++++++++++------ conjure/types/types.go | 49 ++++++++++---- conjure/types/types_test.go | 58 +++++++++++++++++ go.sum | 64 ------------------- .../client/api/servers.conjure.go | 17 +++++ .../client/api/services.conjure.go | 18 ++++++ .../testgenerated/client/client-service.yml | 3 + .../server/api/servers.conjure.go | 17 +++++ .../server/api/services.conjure.go | 23 +++++++ .../testgenerated/server/clientparam_test.go | 41 ++++++++++++ .../testgenerated/server/server-service.yml | 3 + .../testgenerated/server/server_test.go | 4 ++ 15 files changed, 347 insertions(+), 95 deletions(-) create mode 100644 changelog/@unreleased/pr-191.v2.yml diff --git a/changelog/@unreleased/pr-191.v2.yml b/changelog/@unreleased/pr-191.v2.yml new file mode 100644 index 000000000..cd0082598 --- /dev/null +++ b/changelog/@unreleased/pr-191.v2.yml @@ -0,0 +1,10 @@ +type: improvement +improvement: + description: Fixes issue where generated Conjure clients and servers did not properly handle empty responses for Conjure + endpoints returning `optional`. + The Conjure specification states that endpoints returning `optional` should return a 204 status code to + indicate an empty optional (to distinguish from the case where the response is a present optional of 0 length). + This change interprets `optional` as `*ReadCloser` (rather than `ReadCloser') and updates the server to mark + 'nil' responses with a 204 status code. Correspondingly, clients return 'nil' when the response has a 204 status code. + links: + - https://github.com/palantir/conjure-go/pull/191 diff --git a/conjure/conjure_test.go b/conjure/conjure_test.go index 3ea691666..c62ceff4f 100644 --- a/conjure/conjure_test.go +++ b/conjure/conjure_test.go @@ -1007,6 +1007,25 @@ func NewExampleUnionFromRecursive(v ExampleUnion) ExampleUnion { }, "markers" : [ ] }, { + "endpointName" : "maybeStreamResponse", + "httpMethod" : "GET", + "httpPath" : "/catalog/maybe/streamResponse", + "auth" : { + "type" : "header", + "header" : { } + }, + "args" : [ ], + "returns" : { + "type" : "optional", + "optional" : { + "itemType" : { + "type" : "primitive", + "primitive" : "BINARY" + } + } + }, + "markers" : [ ] + }, { "endpointName" : "queryParams", "httpMethod" : "GET", "httpPath" : "/catalog/echo", @@ -1052,6 +1071,7 @@ import ( "context" "fmt" "io" + "net/http" "net/url" "github.com/palantir/conjure-go-runtime/v2/conjure-go-client/httpclient" @@ -1064,6 +1084,7 @@ type TestServiceClient interface { GetFileSystems(ctx context.Context, authHeader bearertoken.Token) (map[string]int, error) CreateDataset(ctx context.Context, cookieToken bearertoken.Token, requestArg string) error StreamResponse(ctx context.Context, authHeader bearertoken.Token) (io.ReadCloser, error) + MaybeStreamResponse(ctx context.Context, authHeader bearertoken.Token) (*io.ReadCloser, error) QueryParams(ctx context.Context, inputArg string, repsArg int) error } @@ -1123,6 +1144,23 @@ func (c *testServiceClient) StreamResponse(ctx context.Context, authHeader beare return resp.Body, nil } +func (c *testServiceClient) MaybeStreamResponse(ctx context.Context, authHeader bearertoken.Token) (*io.ReadCloser, error) { + var requestParams []httpclient.RequestParam + requestParams = append(requestParams, httpclient.WithRPCMethodName("MaybeStreamResponse")) + requestParams = append(requestParams, httpclient.WithRequestMethod("GET")) + requestParams = append(requestParams, httpclient.WithHeader("Authorization", fmt.Sprint("Bearer ", authHeader))) + requestParams = append(requestParams, httpclient.WithPathf("/catalog/maybe/streamResponse")) + requestParams = append(requestParams, httpclient.WithRawResponseBody()) + resp, err := c.client.Do(ctx, requestParams...) + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusNoContent { + return nil, nil + } + return &resp.Body, nil +} + func (c *testServiceClient) QueryParams(ctx context.Context, inputArg string, repsArg int) error { var requestParams []httpclient.RequestParam requestParams = append(requestParams, httpclient.WithRPCMethodName("QueryParams")) @@ -1146,6 +1184,7 @@ type TestServiceClientWithAuth interface { GetFileSystems(ctx context.Context) (map[string]int, error) CreateDataset(ctx context.Context, requestArg string) error StreamResponse(ctx context.Context) (io.ReadCloser, error) + MaybeStreamResponse(ctx context.Context) (*io.ReadCloser, error) QueryParams(ctx context.Context, inputArg string, repsArg int) error } @@ -1171,6 +1210,10 @@ func (c *testServiceClientWithAuth) StreamResponse(ctx context.Context) (io.Read return c.client.StreamResponse(ctx, c.authHeader) } +func (c *testServiceClientWithAuth) MaybeStreamResponse(ctx context.Context) (*io.ReadCloser, error) { + return c.client.MaybeStreamResponse(ctx, c.authHeader) +} + func (c *testServiceClientWithAuth) QueryParams(ctx context.Context, inputArg string, repsArg int) error { return c.client.QueryParams(ctx, inputArg, repsArg) } diff --git a/conjure/serverwriter.go b/conjure/serverwriter.go index 81cfb6cfd..2aec1232b 100644 --- a/conjure/serverwriter.go +++ b/conjure/serverwriter.go @@ -454,11 +454,23 @@ func getReturnStatements( body = append(body, getIfErrNotNilReturnErrExpression()) var codec types.Typer + var respArg string if isBinary, err := isBinaryType(*endpoint.Returns); err != nil { return nil, err } else if isBinary { + isOptional, err := visitors.IsSpecificConjureType(*endpoint.Returns, visitors.IsOptional) + if err != nil { + return nil, err + } + if isOptional { + body = append(body, getOptionalBinaryStatusNoContentExpression()) + respArg = "*" + responseArgVarName + } else { + respArg = responseArgVarName + } codec = types.CodecBinary } else { + respArg = responseArgVarName codec = types.CodecJSON } info.AddImports(codec.ImportPaths()...) @@ -479,7 +491,7 @@ func getReturnStatements( Values: []astgen.ASTExpr{ expression.NewCallFunction(codec.GoType(info), codecEncodeFunc, expression.VariableVal(responseWriterVarName), - expression.VariableVal(responseArgVarName), + expression.VariableVal(respArg), ), }, }) @@ -821,6 +833,29 @@ func getIfErrNotNilReturnErrExpression() astgen.ASTStmt { } } +// getOptionalBinaryStatusNoContentExpression returns an expression used for optional endpoints to distinguish +// between zero length present binaries and empty binaries. Specifically, empty binaries are marked with a StatusNoContent +// status code per the conjure spec. +func getOptionalBinaryStatusNoContentExpression() astgen.ASTStmt { + return &statement.If{ + Cond: &expression.Binary{ + LHS: expression.VariableVal(responseArgVarName), + Op: token.EQL, + RHS: expression.Nil, + }, + Body: []astgen.ASTStmt{ + statement.NewExpression(&expression.CallExpression{ + Function: &expression.Selector{ + Receiver: expression.VariableVal(responseWriterVarName), + Selector: "WriteHeader", + }, + Args: []astgen.ASTExpr{expression.Type("http.StatusNoContent")}}), + statement.NewReturn( + expression.Nil, + ), + }} +} + func getIfErrNotNilExpression() astgen.ASTExpr { return &expression.Binary{ LHS: expression.VariableVal(errorName), diff --git a/conjure/servicewriter.go b/conjure/servicewriter.go index 770f73bfc..f5fc28d91 100644 --- a/conjure/servicewriter.go +++ b/conjure/servicewriter.go @@ -810,10 +810,38 @@ func serviceStructMethodBodyAST(endpointDefinition spec.EndpointDefinition, retu body = append(body, ifErrNotNilReturnHelper(hasReturnVal, valVarToReturnInErr, errVar, nil)) if returnsBinary { + isOptional, err := isReturnTypeSpecificType(endpointDefinition.Returns, visitors.IsOptional) + if err != nil { + return nil, err + } + binaryRespVar := respVar + if isOptional { + // If an endpoint with a return type of optional provides a response with a code of StatusNoContent + // then the return value is empty and nil is returned. + body = append(body, &statement.If{ + Cond: &expression.Binary{ + LHS: expression.NewSelector( + expression.VariableVal(respVar), + "StatusCode", + ), + Op: token.EQL, + RHS: expression.Type("http.StatusNoContent"), + }, + Body: []astgen.ASTStmt{ + statement.NewReturn( + expression.Nil, + expression.Nil, + ), + }, + }) + info.AddImports("net/http") + // if endpoint returns binary, return pointer to body of response directly + binaryRespVar = "&" + respVar + } // if endpoint returns binary, return body of response directly body = append(body, statement.NewReturn( expression.NewSelector( - expression.VariableVal(respVar), + expression.VariableVal(binaryRespVar), "Body", ), expression.Nil, @@ -1018,26 +1046,17 @@ func returnTypesForEndpoint(endpointDefinition spec.EndpointDefinition, info typ var returnTypes []expression.Type imports := make(StringSet) if endpointDefinition.Returns != nil { - var goType string - returnBinary, err := isReturnTypeSpecificType(endpointDefinition.Returns, visitors.IsBinary) + typer, err := visitors.NewConjureTypeProviderTyper(*endpointDefinition.Returns, info) if err != nil { return nil, nil, err } - if returnBinary { - // special case: "binary" type resolves to []byte in structs, but indicates a streaming response when - // specified as the return type of a service, so use "io.ReadCloser". - goType = types.IOReadCloserType.GoType(info) - imports.AddAll(NewStringSet(types.IOReadCloserType.ImportPaths()...)) - } else { - typer, err := visitors.NewConjureTypeProviderTyper(*endpointDefinition.Returns, info) - if err != nil { - return nil, nil, err - } - goType = typer.GoType(info) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to process return type %q", goType) - } - } + + // special case: "binary" type resolves to []byte in structs, but indicates a streaming response when + // specified as the return type of a service, so replace all nested references with "io.ReadCloser". + var readCloserImports []string + typer, readCloserImports = types.MapBinaryTypeToReadCloserType(typer) + imports.AddAll(NewStringSet(readCloserImports...)) + goType := typer.GoType(info) returnTypes = append(returnTypes, expression.Type(goType)) } return append(returnTypes, expression.ErrorType), imports, nil diff --git a/conjure/types/types.go b/conjure/types/types.go index 651b3860e..32626e2aa 100644 --- a/conjure/types/types.go +++ b/conjure/types/types.go @@ -196,23 +196,33 @@ func (t *mapType) ImportPaths() []string { return append(t.keyType.ImportPaths(), t.valType.ImportPaths()...) } -type singleGenericValType struct { - valType Typer - fmtString string +type iterableValType struct { + valType Typer } -func (t *singleGenericValType) GoType(info PkgInfo) string { - return fmt.Sprintf(t.fmtString, t.valType.GoType(info)) +func (t *iterableValType) GoType(info PkgInfo) string { + return fmt.Sprintf("[]%s", t.valType.GoType(info)) } -func (t *singleGenericValType) ImportPaths() []string { +func (t *iterableValType) ImportPaths() []string { + return t.valType.ImportPaths() +} + +type optionalGenericValType struct { + valType Typer +} + +func (t *optionalGenericValType) GoType(info PkgInfo) string { + return fmt.Sprintf("*%s", t.valType.GoType(info)) +} + +func (t *optionalGenericValType) ImportPaths() []string { return t.valType.ImportPaths() } func NewListType(valType Typer) Typer { - return &singleGenericValType{ - valType: valType, - fmtString: "[]%s", + return &iterableValType{ + valType: valType, } } @@ -228,9 +238,8 @@ func NewSetType(valType Typer) Typer { } func NewOptionalType(valType Typer) Typer { - return &singleGenericValType{ - valType: valType, - fmtString: "*%s", + return &optionalGenericValType{ + valType: valType, } } @@ -326,3 +335,19 @@ func (f *funcType) ImportPaths() []string { } return importPaths } + +// MapBinaryTypeToReadCloserType replaces BinaryType and OptionalType with IOReadCloserType and +// OptionalType respectively. It also returns IOReadCloserType's imports if a binary +// reference is found. +func MapBinaryTypeToReadCloserType(valType Typer) (Typer, []string) { + if valType == BinaryType { + return IOReadCloserType, IOReadCloserType.ImportPaths() + } + if v, ok := valType.(*optionalGenericValType); ok { + typer, importPaths := MapBinaryTypeToReadCloserType(v.valType) + return &optionalGenericValType{ + valType: typer, + }, importPaths + } + return valType, nil +} diff --git a/conjure/types/types_test.go b/conjure/types/types_test.go index 0b5c61445..0507ec098 100644 --- a/conjure/types/types_test.go +++ b/conjure/types/types_test.go @@ -181,3 +181,61 @@ func TestFunctionTypes(t *testing.T) { }) } } + +func TestReadCloseMapper(t *testing.T) { + + for _, test := range []struct { + name string + initialTyper Typer + desiredTyper Typer + hasImports bool + }{ + { + name: "String type", + initialTyper: String, + desiredTyper: String, + }, + { + name: "SafeLong type", + initialTyper: SafeLong, + desiredTyper: SafeLong, + }, + { + name: "Binary type", + initialTyper: BinaryType, + desiredTyper: IOReadCloserType, + hasImports: true, + }, + { + name: "Optional String type", + initialTyper: NewOptionalType(String), + desiredTyper: NewOptionalType(String), + }, + { + name: "Optional SafeLong type", + initialTyper: NewOptionalType(SafeLong), + desiredTyper: NewOptionalType(SafeLong), + }, + { + name: "Optional Binary type", + initialTyper: NewOptionalType(BinaryType), + desiredTyper: NewOptionalType(IOReadCloserType), + hasImports: true, + }, + { + name: "List Binary type", + initialTyper: NewListType(BinaryType), + desiredTyper: NewListType(BinaryType), + }, + } { + t.Run(test.name, func(t *testing.T) { + typer, imports := MapBinaryTypeToReadCloserType(test.initialTyper) + assert.Equal(t, typer, test.desiredTyper) + if test.hasImports { + assert.Equal(t, imports, IOReadCloserType.ImportPaths()) + } else { + assert.Nil(t, imports) + } + }) + } +} diff --git a/go.sum b/go.sum index d417acf81..7ae219125 100644 --- a/go.sum +++ b/go.sum @@ -40,14 +40,12 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/danverbraganza/varcaser v0.0.0-20190207223536-e3fb03ee5b4c h1:Cr+ys+/EMxJs+UXAzvqzCmHDr9Dg++13M4UwojqBnrQ= github.com/danverbraganza/varcaser v0.0.0-20190207223536-e3fb03ee5b4c/go.mod h1:YWV0l74TmlOT2brYeVE8RsriZ3CQ4CsP8z5mqAOg4PQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 h1:eX+pdPPlD279OWgdx7f6KqIRSONuK7egk+jDx7OM3Ac= github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76/go.mod h1:KjxHHirfLaw19iGT70HvVjHQsL1vq1SRQB4yOsAfy2s= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= @@ -57,7 +55,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= @@ -79,7 +76,6 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -98,9 +94,7 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -181,11 +175,9 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/nmiyake/pkg v0.0.0-20170627000939-b64318170fde/go.mod h1:1mqQ24p9iRljD6gKVkWOwMJRvbzgbyAtb0zALIt0lis= github.com/nmiyake/pkg v0.0.1 h1:LooujgshxOHQsPpluVqzOwBV9dUEZXIxOkotRMXbBGQ= github.com/nmiyake/pkg v0.0.1/go.mod h1:078BHtQj5Tk8Im6EpMHR0/Stp79lwL3FIRiGaC9hTDM= -github.com/nmiyake/pkg/dirs v1.0.0 h1:pYeIw1wH7jh5/ew8naGE4Q56byJG7Uyi8PwwhVe/MTg= github.com/nmiyake/pkg/dirs v1.0.0/go.mod h1:r6/PkZ3CA1szGfQkxcHheEjBWi6Zu6jLb+lQmRXEyvM= github.com/nmiyake/pkg/dirs v1.0.1 h1:6XR5GC5MmvEIHStzt68awt724HHcU3Hzo7DHOes3PnM= github.com/nmiyake/pkg/dirs v1.0.1/go.mod h1:elT/e4eppUhEnC5nADzWy3GzcrixmZXsx1EkKa3445s= -github.com/nmiyake/pkg/errorstringer v1.0.0 h1:i8VFMHpy2orAs8Lsoi7wOdQ6ipxOUe9GRzimcNCEzBk= github.com/nmiyake/pkg/errorstringer v1.0.0/go.mod h1:M7rsuKy+fiW7j812cNTScqf7kixe7k/ETY/+cbaqzRw= github.com/nmiyake/pkg/errorstringer v1.0.1 h1:ICQ3Rnoe6CLlIc7N5z9LWgNrjvZxoQctgUDv5JBKncI= github.com/nmiyake/pkg/errorstringer v1.0.1/go.mod h1:wPprrlOJdHcA/bz50i8EIvCsgxMXGS8yLWv17wBK7as= @@ -202,15 +194,11 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/palantir/conjure-go-runtime v0.4.0 h1:xmSzYVv27wnKNCcmtamcO9XpI6+Yig/cNElomWU72f4= github.com/palantir/conjure-go-runtime v0.4.0/go.mod h1:7tsjwMKuzyqjGCpKI7bVbZ3T68nvoFFPj2UrcFIETtQ= github.com/palantir/conjure-go-runtime/v2 v2.1.0/go.mod h1:k4+u7YJwBAO6Kk7SGvFCQR7vrkVW8vgQxO8rPZGuS5g= -github.com/palantir/conjure-go-runtime/v2 v2.2.0 h1:3Z/cwOvZz+dkBh3nXRWvGBqOXJgU2lHtG5DozZO3UjA= github.com/palantir/conjure-go-runtime/v2 v2.2.0/go.mod h1:k4+u7YJwBAO6Kk7SGvFCQR7vrkVW8vgQxO8rPZGuS5g= -github.com/palantir/conjure-go-runtime/v2 v2.8.0 h1:PRfYLJ2LSq0GaIKlgbtUkq2AO+XeRNv3mpJL0hHXpJQ= github.com/palantir/conjure-go-runtime/v2 v2.8.0/go.mod h1:tTeTRoO23DHx/3E3HLfhbwh98Byrmp1cdk8m9kcZ2M4= github.com/palantir/conjure-go-runtime/v2 v2.9.1 h1:3C2q+fbTbBAymd2B55jHVGgskOyR7yduslb0ySGmp4o= github.com/palantir/conjure-go-runtime/v2 v2.9.1/go.mod h1:rhOuZSp5lge3JKD5gzAFRb93uA1/jfmeefpH2evRAug= -github.com/palantir/conjure-go/v4 v4.2.0 h1:VhZ6/2SBZ7pLiXWMmu371+2NtVNmSJfwcFzGLBE83pQ= github.com/palantir/conjure-go/v4 v4.2.0/go.mod h1:VSVefkM94TdXRyP7wvBeURBNOFkYRJEtxPi8BeyKFi8= -github.com/palantir/conjure-go/v5 v5.0.1 h1:7ljpRaVCeT4vqEV1UxodJ+MgZv1nNce5Gg5FSohAE4Q= github.com/palantir/conjure-go/v5 v5.0.1/go.mod h1:qAWik7iYoJtlHwyJ/sG0FuJx1PtzrLVCUglLH1k7NrE= github.com/palantir/distgo v1.2.0/go.mod h1:jOCcoLD92T/eN4VfRxczaDIWsqyy1f0yQZMFOt3cJCw= github.com/palantir/distgo v1.20.0/go.mod h1:Jfsd7o7+kzCY8a3xpbPabr5IMjW6zSNOKLTNa8TJH4g= @@ -220,99 +208,79 @@ github.com/palantir/go-metrics v1.1.0 h1:gf6W9EBvzREheH/3wNLPmJD8pe+xtag3TjePZe4 github.com/palantir/go-metrics v1.1.0/go.mod h1:fRkuipBnsI4nD8Vd9UNcrUJvD8Y0wOJMSbicygcBrGs= github.com/palantir/go-ptimports/v2 v2.9.0 h1:Rn6jywDXRKvZP3BOAhnmSSGJf/4X8SBL+fft0CG8M3Y= github.com/palantir/go-ptimports/v2 v2.9.0/go.mod h1:IaMVT1K+5C/5wpANqNLPhbFWjdo27J7HDKMBwDMUwAA= -github.com/palantir/goastwriter v0.0.1 h1:1MdrTwAg8EDx/n+Rf7HeA8ItZepcH2UvPQm2AugPn6U= github.com/palantir/goastwriter v0.0.1/go.mod h1:CzTlNu38b4eUbE3B9UBOy6oC5GMB1uGsJ4Zd7RAsRK8= github.com/palantir/goastwriter v0.1.0 h1:9F0QlLD4sW84nssudASIRYrS0rApF+/QrMAoPCayCZo= github.com/palantir/goastwriter v0.1.0/go.mod h1:CzTlNu38b4eUbE3B9UBOy6oC5GMB1uGsJ4Zd7RAsRK8= github.com/palantir/godel-conjure-plugin v4.3.0+incompatible h1:KemsVTsO+Y7bZobz+x6nObirDB14/9ec6uTicyKLMxo= github.com/palantir/godel-conjure-plugin v4.3.0+incompatible/go.mod h1:O8oT8D40k1aMKuMcdVLZ/wHIweabXc1xBS/y1YqKS7U= -github.com/palantir/godel-conjure-plugin/v4 v4.4.0 h1:YLsDFLRYt1/iXPUbspSo3WzRYL+h+lKvFcw73V7zIns= github.com/palantir/godel-conjure-plugin/v4 v4.4.0/go.mod h1:ffjwJ5TDgxbw1WXyiK3QwtV0E7DyqUNAyDzd5hC/AuI= github.com/palantir/godel-conjure-plugin/v5 v5.1.0 h1:bM7SsqZhD7CRksCMUoqT55mS+bgAeIgydm0etU8uxFU= github.com/palantir/godel-conjure-plugin/v5 v5.1.0/go.mod h1:zWHH7de5ZBPguLEXgwUxe7Z20UsRUWrZm6wMKnT5iaE= github.com/palantir/godel/pkg/products/v2 v2.0.0 h1:E3DuAEA1yotLLDQt7vIrYRapRwXRyW6u8Yuq2p/qyLs= github.com/palantir/godel/pkg/products/v2 v2.0.0/go.mod h1:SaLUycZLVP5qV6mL9MWG3jkX4dS23lJnzpubTGAV4FU= -github.com/palantir/godel/v2 v2.22.0 h1:6uzSkN72gJO07QBxgSw3wmr63sr3NN1AkcJUXlmNfkI= github.com/palantir/godel/v2 v2.22.0/go.mod h1:Da/HS4lwo4j/v/PpmpJxgfamjg4Jwp6qPSnPzAr0Ppk= github.com/palantir/pkg v0.0.0-20180424172112-23395ebeee5d/go.mod h1:jLbXCfQ4HRrT5RRj5JuKc1ucQeridBMyRCpmzRtUYMY= github.com/palantir/pkg v0.0.0-20181230161202-d12f4064ff8e/go.mod h1:jLbXCfQ4HRrT5RRj5JuKc1ucQeridBMyRCpmzRtUYMY= github.com/palantir/pkg v1.0.1 h1:ZbGUcc14N7xcZSY9cehQoiHHTm/BAZO5RJdlsNEtSbk= github.com/palantir/pkg v1.0.1/go.mod h1:Eo6Jl0UXfT+65sLXJOcU9duu0WPvKsWFXCb0dE5VWZs= -github.com/palantir/pkg/bearertoken v1.0.0 h1:mHrsZ/hqz1j2l65Yp04KnIkq15lRYxKzlgKQ+X7TTB8= github.com/palantir/pkg/bearertoken v1.0.0/go.mod h1:avqDPtNT8TtRgLsOctPfGXwD62AWBMbhNn4iIv0GKo4= github.com/palantir/pkg/bearertoken v1.0.1 h1:GoWT/ihU6YHZFonvFRWiAcWQxpdNF+K3rBKSifBnbBU= github.com/palantir/pkg/bearertoken v1.0.1/go.mod h1:2Cv+3lHNBZLge2i0HehP1K5GCnkhE6YZrJLVXJcskG0= -github.com/palantir/pkg/binary v1.0.0 h1:fYH7ezsXNIfGWPUwl48LGxbGMAKs31UCszWA7IUsOKM= github.com/palantir/pkg/binary v1.0.0/go.mod h1:fARS9aw2WQBGHh1I68LnVEi6nnGXe1UwWQTOr2K8Ack= github.com/palantir/pkg/binary v1.0.1 h1:sMAcooNCkC0VU7W3wTQECigHM3pxmXwHZN53/pM8bpo= github.com/palantir/pkg/binary v1.0.1/go.mod h1:fCwVNRbc0rEuqDcmGSwdgx4cqBq7/5zUD1BS8DsCm64= github.com/palantir/pkg/boolean v1.0.0 h1:Uznv3GJ9xmdP/AFfBlpv1qzNdROsyaLY9CInB07gU8c= github.com/palantir/pkg/boolean v1.0.0/go.mod h1:uGQK9vNvMHZF4zKXb15tiYokElb1a0z8zCJpQ5R36f0= -github.com/palantir/pkg/bytesbuffers v1.0.0 h1:ImSRQqOyouBFU9HfjINF2zlFNejY9THJrSMhnJfFgf0= github.com/palantir/pkg/bytesbuffers v1.0.0/go.mod h1:JFWINutL8wfBpXOqastvJtuEXNEQhIVNnBVY0oeJFws= github.com/palantir/pkg/bytesbuffers v1.0.1 h1:I4ejeyYuMmIiplfPuKDycvtm7O2G6SffNrBqEWvAWJI= github.com/palantir/pkg/bytesbuffers v1.0.1/go.mod h1:tmmrI9egWT9g6oBhcO3bsd+R5HOxNiNMkTelr2+W2vg= -github.com/palantir/pkg/cobracli v1.0.0 h1:hhkWxrqRdsXM6mMbXovVnUrZRitmKNu8SgC+XQP9kzI= github.com/palantir/pkg/cobracli v1.0.0/go.mod h1:AneQq9QEiEHnx61jDASdobjCwKKSkWLVVsyoMpgmy74= github.com/palantir/pkg/cobracli v1.0.1 h1:RLAL+bWRcFVqX1XHDQZp6V2vZYN483U0HE9dhp2W+WQ= github.com/palantir/pkg/cobracli v1.0.1/go.mod h1:UfYLriXzhyx7a3r+3UTD+kbX+xASjr9kSK05fC85NyI= -github.com/palantir/pkg/datetime v1.0.0 h1:hV442fTe738bMHuxkECrQhdAx7ku7oO2LLrY7K4konc= github.com/palantir/pkg/datetime v1.0.0/go.mod h1:s01MDVkY8pZEP+sbAIbXxiAsS+mPLHla3cFnQ2pk//g= github.com/palantir/pkg/datetime v1.0.1 h1:jxJmpTZYrb0mzD8vD0ct0ii7iClWvgzS8Wbct17IDso= github.com/palantir/pkg/datetime v1.0.1/go.mod h1:Xx0XxVNJKPZRPw4xkNJ2qLNTLqGFu5QW6rAWeuoATBs= github.com/palantir/pkg/gittest v1.0.0/go.mod h1:M49S4TsX5sh7lYJmOF+pFzcB4fJNOylzN8tOdpSq958= -github.com/palantir/pkg/httpserver v1.0.0 h1:OHiEZCSzOGxi/KG0DOU3mIpCsiJQrZDsYKeNRG2fArc= github.com/palantir/pkg/httpserver v1.0.0/go.mod h1:SB44Ogix4t8LFq8eV57m8NYZgx0FnjaC9uIsoOvkE9o= github.com/palantir/pkg/httpserver v1.0.1 h1:50GykXrOIZ6U4OWz3o4jDCK4ql4h3TnldusqIi/75zs= github.com/palantir/pkg/httpserver v1.0.1/go.mod h1:e8lGJPRqfS7wyfYaTezWIHlcpkTLxFFevm1Bhh3LW94= github.com/palantir/pkg/matcher v1.0.0/go.mod h1:QCvRrP7D1ZwHguKkovtcPbr0i2L8GYXQxq9EUn/ME6s= -github.com/palantir/pkg/metrics v1.0.0 h1:C11EXaB4e9DbeccCoaBv0FOSdQZ9SkNeDP1vpPyhI68= github.com/palantir/pkg/metrics v1.0.0/go.mod h1:bQgc6o1wUY8hEamP/BX5IYUq9hCYVRGhcCWlxfcqNRw= github.com/palantir/pkg/metrics v1.0.1 h1:d3KLSlm5JVRH/y86XBZZazYufOKowij3pH5ry2YytKc= github.com/palantir/pkg/metrics v1.0.1/go.mod h1:nbKCQCZecI4XdBWpFPVesEDNzB0FLZb1jvayrHW6skM= -github.com/palantir/pkg/objmatcher v1.0.0 h1:TrVWmiruKaPgYbxvAFk3TlWtb1L72jo0/6Jw4udTEmU= github.com/palantir/pkg/objmatcher v1.0.0/go.mod h1:r/JGd9x5OOgTCoaHt7qSSRX7jAheaJ88nAWytWsrwN0= github.com/palantir/pkg/objmatcher v1.0.1 h1:rzKVO2LXVR2ND7t9Hi3Q+sfFh1RZ5Liq/zmsz0vlgdw= github.com/palantir/pkg/objmatcher v1.0.1/go.mod h1:rTHUAN1LduHN+5fMTPkO5w+JHTidSmn5AsK885x2mvs= github.com/palantir/pkg/pkgpath v1.0.0/go.mod h1:J5UJF5BdA+Y0CSGw98BJXouxQP4jkXS4duTUjCQLe3c= github.com/palantir/pkg/refreshable v1.0.0 h1:pfNYjvpNHUE/bUDZM/O1FRK6uNY5StvStWqU+oQYHak= github.com/palantir/pkg/refreshable v1.0.0/go.mod h1:92rISykbd0wXVYpkT41CU7nZstnLsPwT8iFDCdlJoJM= -github.com/palantir/pkg/retry v1.0.0 h1:QVgD2vfjRFG7BlUaOlddpsEgpJ7LNqoGxgy4KO+WIJ4= github.com/palantir/pkg/retry v1.0.0/go.mod h1:/LJ8kSqgmyNvUKVU0ZSkNLfQ47ufKIZKhEk211pQZ7s= github.com/palantir/pkg/retry v1.1.1 h1:rwZ4rrOpudvWFeSrkWvXVLgZKRsp+D8digPJUXZMmw8= github.com/palantir/pkg/retry v1.1.1/go.mod h1:TdzhQIVAaNwpezz4OSibhZAFBYuAoJ16yZXyhJEQ9h8= -github.com/palantir/pkg/rid v1.0.0 h1:QYx1xCzskX0+rj/lZO4zps5k/VWRWohZWZztxWRSoxc= github.com/palantir/pkg/rid v1.0.0/go.mod h1:cGNNJM5A2AyxxW3ZyNC0Vr2YOOBXyW6EpWny4b6A8Ks= github.com/palantir/pkg/rid v1.0.1 h1:hEC4I1C3ym6eUUX8+H+xWfselLVdJ1JzHEuRQI31ZrI= github.com/palantir/pkg/rid v1.0.1/go.mod h1:tfw9Cj6vhgq6A6+bXwZVcoa0iUrhWpamq/dAUFxFl+s= github.com/palantir/pkg/safehttp v1.0.0/go.mod h1:ngXeURw3fGczTQqKl9NRZ3wFnkDifw/jSn9ijrC9xOE= github.com/palantir/pkg/safehttp v1.0.1/go.mod h1:9qijSGPyrYRbwTqgct5UwxAt8SiKTCFpgu2ESiC3wzQ= -github.com/palantir/pkg/safejson v1.0.0 h1:uMRaxVwRC45AcDCvdr930TDOluec13zYwKiZ0wKNRWs= github.com/palantir/pkg/safejson v1.0.0/go.mod h1:lrqgYn4dju1TbU+pf3gEQtzAbQtaGrTHa3860bus8tM= github.com/palantir/pkg/safejson v1.0.1 h1:VfpUJrdOnRm2m2ZBHXuVkdGbZd+B0ZrH8FpPxrPtMcc= github.com/palantir/pkg/safejson v1.0.1/go.mod h1:jZEXk2DnsOJCv3zgXq+GvMZvZOW8sw5FP8NG4IfTxD8= -github.com/palantir/pkg/safelong v1.0.0 h1:CLtdL8mf3uu4mQcyOgYh/OtbUsbpW9Tu5i1uHiuafoc= github.com/palantir/pkg/safelong v1.0.0/go.mod h1:2Pabf6SbeE2kerW1RyPGREZroNIQ9HvXKxCux0N5C3k= github.com/palantir/pkg/safelong v1.0.1 h1:l5IDwT1aAQ1FeyMG77kPnsEUb0z5bQXYYXVTTNJpP2E= github.com/palantir/pkg/safelong v1.0.1/go.mod h1:+uJuPdYul/jhsplszUwPu+jlc4E7Z4ZMNCuIXbMoyR8= -github.com/palantir/pkg/safeyaml v1.0.0 h1:4YwdQYIEOCD8eMWwyIal8Oejm6ETiBA7etKIeEQUA+s= github.com/palantir/pkg/safeyaml v1.0.0/go.mod h1:g0GfNcalrnCZbwyZbW0OBmtHdjLXK7dG1oEk/ew+cB8= github.com/palantir/pkg/safeyaml v1.0.1 h1:4cSUj9Ttnwydq4vxB8NSxe+qhquBYYtMuJbw6EuSZpQ= github.com/palantir/pkg/safeyaml v1.0.1/go.mod h1:rwADKpvXsYupKvXJg4pOuPrwK8F4Ki95VIq6lHjUqyA= -github.com/palantir/pkg/signals v1.0.0 h1:5jkV2H8HNNS7gsNzRmq2nn9f1N8DGfKBGkmGphTeLR4= github.com/palantir/pkg/signals v1.0.0/go.mod h1:QyB+IUVaQh0R0KEEJlAzo0SToasn+xELn8jZ7D+LHvk= github.com/palantir/pkg/signals v1.0.1 h1:WDapfUO/vq6DoN4hHmowy2kEDaCQxNCZUhORUn2L4Ig= github.com/palantir/pkg/signals v1.0.1/go.mod h1:L5/ZeqXa2QjdxpjqcMQ4LtZL3xCp1FMEhGjMHyLDb2g= github.com/palantir/pkg/specdir v1.0.0/go.mod h1:nYG8Q6yqi1VrQmeUSFN9vT3DIf0q/Xhgn6X3jzwetMs= -github.com/palantir/pkg/tlsconfig v1.0.0 h1:Ivvntm4LFe7aXKzMzZkxDq12nvdAhKllchijXBTgJI4= github.com/palantir/pkg/tlsconfig v1.0.0/go.mod h1:pyDZXpSYm5J6r/4Fm6mjDV25Oe1aMsrgTjkCccKt8MM= -github.com/palantir/pkg/tlsconfig v1.0.1 h1:QlOLCSsUnrZJrNnWMIegDBULVjsyAgFJ8q6Q+8ukizU= github.com/palantir/pkg/tlsconfig v1.0.1/go.mod h1:GmXODSYyPva3huR2pEaAknSGIcyRPy08Hvr38WP5+W4= github.com/palantir/pkg/tlsconfig v1.0.2 h1:N6yw9WPkoYpO1lXF58W1cmYK0nEoek5MZswFqpKOoc4= github.com/palantir/pkg/tlsconfig v1.0.2/go.mod h1:GmXODSYyPva3huR2pEaAknSGIcyRPy08Hvr38WP5+W4= github.com/palantir/pkg/transform v1.0.0 h1:21MzkUg9fQgIdadTYMM1Z1qrml2MVdpNY5ai27G15LM= github.com/palantir/pkg/transform v1.0.0/go.mod h1:YH2PQUzswoDayk4rTvKt6B+NcnUJgZRNr9MEqfAMCo0= -github.com/palantir/pkg/uuid v1.0.0 h1:w+61TWaMpaYytAILxzj/3IJvTzLZkZQvYW52H7dK900= github.com/palantir/pkg/uuid v1.0.0/go.mod h1:yCHOTYHJD/zKB1c8sJ2IhIGvPGnYYcp0FgGTnbr5jiM= github.com/palantir/pkg/uuid v1.0.1 h1:wcBLI2wA9IyCgE5o7z8jkfct74BHhC5iD8FNuqp8ZHc= github.com/palantir/pkg/uuid v1.0.1/go.mod h1:pvQXYqMYf8GdAHEFiO4ROL9CEuNX7voJ7TjMPcx3NJo= @@ -322,13 +290,10 @@ github.com/palantir/witchcraft-go-error v1.4.3 h1:coynUoBOhfvd/vsH7gu2v4dlSO+hvl github.com/palantir/witchcraft-go-error v1.4.3/go.mod h1:/cl2dMkuBbnfxDtFiC//8JfvZxmRkYRhgv3bBux9AD0= github.com/palantir/witchcraft-go-health v1.5.0 h1:lj0lhFA1UbqOIdENjXkRPs7IqRhxSu+38nGUbVtU1rA= github.com/palantir/witchcraft-go-health v1.5.0/go.mod h1:oOIMYzOgTJci1XwvmUTrxe4YAY1CmSprbeR6QdY+5w0= -github.com/palantir/witchcraft-go-logging v1.5.0 h1:LxmZ6XuhitMKmNrUQZ3UBU92q6PKPsawV94FlLVUui4= github.com/palantir/witchcraft-go-logging v1.5.0/go.mod h1:x2wqelmEPV2sqOgxnYpx7em44I2nzWuovl7d7cMv+pM= -github.com/palantir/witchcraft-go-logging v1.5.2 h1:1xTnCqOSB5+BVlw4RkN3UWidhMxFT7nNNoRC1wA7scs= github.com/palantir/witchcraft-go-logging v1.5.2/go.mod h1:x2wqelmEPV2sqOgxnYpx7em44I2nzWuovl7d7cMv+pM= github.com/palantir/witchcraft-go-logging v1.9.0 h1:YGsqh6T58F6vPTLii9tvvZTYO6rTb9uDmO4KrYxKvMU= github.com/palantir/witchcraft-go-logging v1.9.0/go.mod h1:6hkyOVxxkoSOVSsL+ZoBVQiFzRSFthlnn47xFOnm6+w= -github.com/palantir/witchcraft-go-params v1.1.0 h1:siRqQv9TuJ0qY2JK5Svd3/rGQQCWvNnjI2OGAftm8gc= github.com/palantir/witchcraft-go-params v1.1.0/go.mod h1:HH+l5b0binfqBJ21qVvQVOJp6s2/I6ld0NEWnaEgWvI= github.com/palantir/witchcraft-go-params v1.2.0 h1:hRaazk4T6ERR/58Ksn7V5/t9CDOhzUIUYaY8J6zgBxI= github.com/palantir/witchcraft-go-params v1.2.0/go.mod h1:HH+l5b0binfqBJ21qVvQVOJp6s2/I6ld0NEWnaEgWvI= @@ -340,12 +305,10 @@ github.com/palantir/witchcraft-go-tracing v1.2.0 h1:+7MinUHafMfF3fDdHVRuQ6fhMi8R github.com/palantir/witchcraft-go-tracing v1.2.0/go.mod h1:rLnl+hlFfUOnHXaL9qMdnp2FoifzWuxsmlFpA+oip2A= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1 h1:VGcrWe3yk6o+t7BdVNy5UDPWa4OZuDWtE1W1ZbS7Kyw= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -382,15 +345,12 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -404,7 +364,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= @@ -414,7 +373,6 @@ github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae/go.mod h1:quDq6Se github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ulikunitz/xz v0.5.4 h1:zATC2OoZ8H1TZll3FpbX+ikwmadbO699PE06cIkm9oU= github.com/ulikunitz/xz v0.5.4/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= @@ -428,18 +386,15 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1 h1:rsqfU5vBkVknbhUGbAUwQKR2H4ItV8tjJ+6kJX4cxHM= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.4.0 h1:f3WCSC2KzAcBXGATIxAB1E2XuCpNU255wNKZ505qi3E= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= @@ -471,7 +426,6 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -490,11 +444,8 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 h1:MlY3mEfbnWGmUi4rtHOtNnnnN4UJRGSyLPx+DXA5Sq4= golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -519,17 +470,14 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -553,21 +501,16 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101 h1:LCmXVkvpQCDj724eX6irUTPCJP5GelFHxqGSWL2D1R0= golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200309202150-20ab64c0d93f h1:NbrfHxef+IfdI86qCgO/1Siq1BuMH2xG0NqgvCguRhQ= golang.org/x/tools v0.0.0-20200309202150-20ab64c0d93f/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200507205054-480da3ebd79c h1:TDspWmUQsjdWzrHnd5imfaJSfhR4AO/R7kG++T2cONw= golang.org/x/tools v0.0.0-20200507205054-480da3ebd79c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9 h1:sEvmEcJVKBNUvgCUClbUQeHOAa9U0I2Ce1BooMvVCY4= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -590,21 +533,17 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.22/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= @@ -617,11 +556,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/integration_test/testgenerated/client/api/servers.conjure.go b/integration_test/testgenerated/client/api/servers.conjure.go index 6efe17414..6fe2f235c 100644 --- a/integration_test/testgenerated/client/api/servers.conjure.go +++ b/integration_test/testgenerated/client/api/servers.conjure.go @@ -26,6 +26,7 @@ type TestService interface { PathParamRidAlias(ctx context.Context, paramArg RidAlias) error Bytes(ctx context.Context) (CustomObject, error) Binary(ctx context.Context) (io.ReadCloser, error) + MaybeBinary(ctx context.Context) (*io.ReadCloser, error) } // RegisterRoutesTestService registers handlers for the TestService endpoints with a witchcraft wrouter. @@ -56,6 +57,9 @@ func RegisterRoutesTestService(router wrouter.Router, impl TestService) error { if err := resource.Get("Binary", "/binary", httpserver.NewJSONHandler(handler.HandleBinary, httpserver.StatusCodeMapper, httpserver.ErrHandler)); err != nil { return werror.Wrap(err, "failed to add route", werror.SafeParam("routeName", "Binary")) } + if err := resource.Get("MaybeBinary", "/optional/binary", httpserver.NewJSONHandler(handler.HandleMaybeBinary, httpserver.StatusCodeMapper, httpserver.ErrHandler)); err != nil { + return werror.Wrap(err, "failed to add route", werror.SafeParam("routeName", "MaybeBinary")) + } return nil } @@ -146,3 +150,16 @@ func (t *testServiceHandler) HandleBinary(rw http.ResponseWriter, req *http.Requ rw.Header().Add("Content-Type", codecs.Binary.ContentType()) return codecs.Binary.Encode(rw, respArg) } + +func (t *testServiceHandler) HandleMaybeBinary(rw http.ResponseWriter, req *http.Request) error { + respArg, err := t.impl.MaybeBinary(req.Context()) + if err != nil { + return err + } + if respArg == nil { + rw.WriteHeader(http.StatusNoContent) + return nil + } + rw.Header().Add("Content-Type", codecs.Binary.ContentType()) + return codecs.Binary.Encode(rw, *respArg) +} diff --git a/integration_test/testgenerated/client/api/services.conjure.go b/integration_test/testgenerated/client/api/services.conjure.go index 786af8aba..0e9c47ab4 100644 --- a/integration_test/testgenerated/client/api/services.conjure.go +++ b/integration_test/testgenerated/client/api/services.conjure.go @@ -6,6 +6,7 @@ import ( "context" "fmt" "io" + "net/http" "net/url" "github.com/palantir/conjure-go-runtime/v2/conjure-go-client/httpclient" @@ -20,6 +21,7 @@ type TestServiceClient interface { PathParamRidAlias(ctx context.Context, paramArg RidAlias) error Bytes(ctx context.Context) (CustomObject, error) Binary(ctx context.Context) (io.ReadCloser, error) + MaybeBinary(ctx context.Context) (*io.ReadCloser, error) } type testServiceClient struct { @@ -126,3 +128,19 @@ func (c *testServiceClient) Binary(ctx context.Context) (io.ReadCloser, error) { } return resp.Body, nil } + +func (c *testServiceClient) MaybeBinary(ctx context.Context) (*io.ReadCloser, error) { + var requestParams []httpclient.RequestParam + requestParams = append(requestParams, httpclient.WithRPCMethodName("MaybeBinary")) + requestParams = append(requestParams, httpclient.WithRequestMethod("GET")) + requestParams = append(requestParams, httpclient.WithPathf("/optional/binary")) + requestParams = append(requestParams, httpclient.WithRawResponseBody()) + resp, err := c.client.Do(ctx, requestParams...) + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusNoContent { + return nil, nil + } + return &resp.Body, nil +} diff --git a/integration_test/testgenerated/client/client-service.yml b/integration_test/testgenerated/client/client-service.yml index 2883e18d6..28f3f23fb 100644 --- a/integration_test/testgenerated/client/client-service.yml +++ b/integration_test/testgenerated/client/client-service.yml @@ -38,3 +38,6 @@ services: binary: http: GET /binary returns: binary + maybeBinary: + http: GET /optional/binary + returns: optional diff --git a/integration_test/testgenerated/server/api/servers.conjure.go b/integration_test/testgenerated/server/api/servers.conjure.go index d43e19598..1bd0b40d0 100644 --- a/integration_test/testgenerated/server/api/servers.conjure.go +++ b/integration_test/testgenerated/server/api/servers.conjure.go @@ -41,6 +41,7 @@ type TestService interface { GetBinary(ctx context.Context) (io.ReadCloser, error) PostBinary(ctx context.Context, myBytesArg io.ReadCloser) (io.ReadCloser, error) PutBinary(ctx context.Context, myBytesArg io.ReadCloser) error + GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) // An endpoint that uses go keywords Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error } @@ -106,6 +107,9 @@ func RegisterRoutesTestService(router wrouter.Router, impl TestService) error { if err := resource.Put("PutBinary", "/binary", httpserver.NewJSONHandler(handler.HandlePutBinary, httpserver.StatusCodeMapper, httpserver.ErrHandler)); err != nil { return werror.Wrap(err, "failed to add route", werror.SafeParam("routeName", "PutBinary")) } + if err := resource.Get("GetOptionalBinary", "/optional/binary", httpserver.NewJSONHandler(handler.HandleGetOptionalBinary, httpserver.StatusCodeMapper, httpserver.ErrHandler)); err != nil { + return werror.Wrap(err, "failed to add route", werror.SafeParam("routeName", "GetOptionalBinary")) + } if err := resource.Post("Chan", "/chan/{var}", httpserver.NewJSONHandler(handler.HandleChan, httpserver.StatusCodeMapper, httpserver.ErrHandler)); err != nil { return werror.Wrap(err, "failed to add route", werror.SafeParam("routeName", "Chan")) } @@ -448,6 +452,19 @@ func (t *testServiceHandler) HandlePutBinary(rw http.ResponseWriter, req *http.R return t.impl.PutBinary(req.Context(), myBytes) } +func (t *testServiceHandler) HandleGetOptionalBinary(rw http.ResponseWriter, req *http.Request) error { + respArg, err := t.impl.GetOptionalBinary(req.Context()) + if err != nil { + return err + } + if respArg == nil { + rw.WriteHeader(http.StatusNoContent) + return nil + } + rw.Header().Add("Content-Type", codecs.Binary.ContentType()) + return codecs.Binary.Encode(rw, *respArg) +} + func (t *testServiceHandler) HandleChan(rw http.ResponseWriter, req *http.Request) error { pathParams := wrouter.PathParams(req) if pathParams == nil { diff --git a/integration_test/testgenerated/server/api/services.conjure.go b/integration_test/testgenerated/server/api/services.conjure.go index 2447fe369..7069837b1 100644 --- a/integration_test/testgenerated/server/api/services.conjure.go +++ b/integration_test/testgenerated/server/api/services.conjure.go @@ -6,6 +6,7 @@ import ( "context" "fmt" "io" + "net/http" "net/url" "github.com/palantir/conjure-go-runtime/v2/conjure-go-client/httpclient" @@ -35,6 +36,7 @@ type TestServiceClient interface { GetBinary(ctx context.Context) (io.ReadCloser, error) PostBinary(ctx context.Context, myBytesArg func() io.ReadCloser) (io.ReadCloser, error) PutBinary(ctx context.Context, myBytesArg func() io.ReadCloser) error + GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) // An endpoint that uses go keywords Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error } @@ -386,6 +388,22 @@ func (c *testServiceClient) PutBinary(ctx context.Context, myBytesArg func() io. return nil } +func (c *testServiceClient) GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) { + var requestParams []httpclient.RequestParam + requestParams = append(requestParams, httpclient.WithRPCMethodName("GetOptionalBinary")) + requestParams = append(requestParams, httpclient.WithRequestMethod("GET")) + requestParams = append(requestParams, httpclient.WithPathf("/optional/binary")) + requestParams = append(requestParams, httpclient.WithRawResponseBody()) + resp, err := c.client.Do(ctx, requestParams...) + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusNoContent { + return nil, nil + } + return &resp.Body, nil +} + func (c *testServiceClient) Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error { var requestParams []httpclient.RequestParam requestParams = append(requestParams, httpclient.WithRPCMethodName("Chan")) @@ -423,6 +441,7 @@ type TestServiceClientWithAuth interface { GetBinary(ctx context.Context) (io.ReadCloser, error) PostBinary(ctx context.Context, myBytesArg func() io.ReadCloser) (io.ReadCloser, error) PutBinary(ctx context.Context, myBytesArg func() io.ReadCloser) error + GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) // An endpoint that uses go keywords Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error } @@ -509,6 +528,10 @@ func (c *testServiceClientWithAuth) PutBinary(ctx context.Context, myBytesArg fu return c.client.PutBinary(ctx, myBytesArg) } +func (c *testServiceClientWithAuth) GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) { + return c.client.GetOptionalBinary(ctx) +} + func (c *testServiceClientWithAuth) Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error { return c.client.Chan(ctx, varArg, importArg, typeArg, returnArg) } diff --git a/integration_test/testgenerated/server/clientparam_test.go b/integration_test/testgenerated/server/clientparam_test.go index 876cf704e..b58ed7ec0 100644 --- a/integration_test/testgenerated/server/clientparam_test.go +++ b/integration_test/testgenerated/server/clientparam_test.go @@ -162,6 +162,47 @@ func TestBinary(t *testing.T) { assert.Equal(t, want, got) } +func TestOptionalBinary_Present(t *testing.T) { + called := false + want := make([]byte, 10) + _, err := rand.Read(want) + require.NoError(t, err) + r := httprouter.New() + r.GET("/optional/binary", httprouter.Handle(func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) { + called = true + _, err = rw.Write(want) + require.NoError(t, err) + })) + server := httptest.NewServer(r) + defer server.Close() + + client := api.NewTestServiceClient(newHTTPClient(t, server.URL)) + rc, err := client.MaybeBinary(context.Background()) + require.NoError(t, err) + assert.True(t, called) + + got, err := ioutil.ReadAll(*rc) + require.NoError(t, err) + assert.Equal(t, want, got) +} + +func TestOptionalBinary_Empty(t *testing.T) { + called := false + r := httprouter.New() + r.GET("/optional/binary", httprouter.Handle(func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) { + called = true + rw.WriteHeader(http.StatusNoContent) + })) + server := httptest.NewServer(r) + defer server.Close() + + client := api.NewTestServiceClient(newHTTPClient(t, server.URL)) + rc, err := client.MaybeBinary(context.Background()) + require.NoError(t, err) + assert.True(t, called) + assert.Nil(t, rc) +} + func newHTTPClient(t *testing.T, url string) httpclient.Client { httpClient, err := httpclient.NewClient( httpclient.WithBaseURLs([]string{url}), diff --git a/integration_test/testgenerated/server/server-service.yml b/integration_test/testgenerated/server/server-service.yml index 079af0a45..821fdea85 100644 --- a/integration_test/testgenerated/server/server-service.yml +++ b/integration_test/testgenerated/server/server-service.yml @@ -190,6 +190,9 @@ services: http: PUT /binary args: myBytes: binary + getOptionalBinary: + http: GET /optional/binary + returns: optional chan: docs: An endpoint that uses go keywords http: POST /chan/{var} diff --git a/integration_test/testgenerated/server/server_test.go b/integration_test/testgenerated/server/server_test.go index 1c976740e..30a10e195 100644 --- a/integration_test/testgenerated/server/server_test.go +++ b/integration_test/testgenerated/server/server_test.go @@ -169,6 +169,10 @@ func (t testServerImpl) PutBinary(ctx context.Context, myBytesArg io.ReadCloser) panic("implement me") } +func (t testServerImpl) GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error) { + panic("implement me") +} + func (t testServerImpl) Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong) error { panic("implement me") }