diff --git a/go.mod b/go.mod index 5098036..a7f2a5e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.1 require ( somehole.com/common/log v0.1.3 somehole.com/common/security v0.2.1 - somehole.com/service/router v0.6.4 + somehole.com/service/router v0.8.0 ) require ( diff --git a/go.sum b/go.sum index cd9a518..4e9c791 100644 --- a/go.sum +++ b/go.sum @@ -8,5 +8,5 @@ somehole.com/common/log v0.1.3 h1:2PAui0+5EryTAHqVUZQeepLcJTGssHKz2OL+jBknHI0= somehole.com/common/log v0.1.3/go.mod h1:NS2eHnN120GA6oFbBm3XhB5yHww0eXTbLuMQYZxYNyA= somehole.com/common/security v0.2.1 h1:H7TpErYKsCOxKYYie75jU7azO5vEgeqrQ9uA+AjXafA= somehole.com/common/security v0.2.1/go.mod h1:6SMKdIrfxT460XXWafpD6A9yT/ykwipGsGztA5g5vVM= -somehole.com/service/router v0.6.4 h1:tA734uvqQqG0LX8UZa7hjmHVMN6LBbNGJraw1CH7kDQ= -somehole.com/service/router v0.6.4/go.mod h1:F+/sNY4/ei7C9QD5+iA+gUHugcOAcrWspHKwX8d8oiM= +somehole.com/service/router v0.8.0 h1:93+qKPpllgWSXGQTvBYLVK565rrFSWTxvMevepDCesY= +somehole.com/service/router v0.8.0/go.mod h1:F+/sNY4/ei7C9QD5+iA+gUHugcOAcrWspHKwX8d8oiM= diff --git a/server/callback.go b/server/callback.go index fffdb50..2b3d53b 100644 --- a/server/callback.go +++ b/server/callback.go @@ -44,7 +44,7 @@ func (crb *CallbackRequestBuilder) Header(header router.Header) (errRes router.E return Ok } -func (crb *CallbackRequestBuilder) Body(body io.ReadCloser) (errRes router.ErrorResponse) { +func (crb *CallbackRequestBuilder) ReadBody(body io.ReadCloser) (errRes router.ErrorResponse) { defer body.Close() return Ok } @@ -77,7 +77,7 @@ func (cr *CallbackResponse) Header() (header router.Header) { return cr.header.Header } -func (cr *CallbackResponse) Bytes() []byte { +func (cr *CallbackResponse) BodyBytes() []byte { return mustMarshalJson(cr.Body) } @@ -92,5 +92,5 @@ func (UnimplementedCallbackServer) Callback(req *CallbackRequestBuilder) (res *C type CallbackServer interface { mustEmbedUnimplementedCallbackServer() - Callback(*CallbackRequestBuilder) (*CallbackResponse, router.ErrorResponse) + Callback(req *CallbackRequestBuilder) (res *CallbackResponse, errRes router.ErrorResponse) } diff --git a/server/error.go b/server/error.go index 2fa25cf..0146651 100644 --- a/server/error.go +++ b/server/error.go @@ -49,7 +49,7 @@ func (e Error) Error() (out string) { return fmt.Sprintf("%s (%d)", e.String(), e.HttpStatus()) } -func (e Error) Bytes() (body []byte) { +func (e Error) BodyBytes() (body []byte) { var msg string switch e { default: diff --git a/server/token.go b/server/token.go index 3b02f0e..6fa6146 100644 --- a/server/token.go +++ b/server/token.go @@ -45,7 +45,7 @@ func (trb *TokenRequestBuilder) Header(header router.Header) (errRes router.Erro return Ok } -func (trb *TokenRequestBuilder) Body(body io.ReadCloser) (errRes router.ErrorResponse) { +func (trb *TokenRequestBuilder) ReadBody(body io.ReadCloser) (errRes router.ErrorResponse) { defer body.Close() return Ok } @@ -82,7 +82,7 @@ func (tr *TokenResponse) Header() (header router.Header) { return tr.header.Header } -func (tr *TokenResponse) Bytes() []byte { +func (tr *TokenResponse) BodyBytes() []byte { return mustMarshalJson(tr.Body) } @@ -97,5 +97,5 @@ func (UnimplementedTokenServer) Token(req *TokenRequestBuilder) (res *TokenRespo type TokenServer interface { mustEmbedUnimplementedTokenServer() - Token(*TokenRequestBuilder) (*TokenResponse, router.ErrorResponse) + Token(req *TokenRequestBuilder) (res *TokenResponse, errRes router.ErrorResponse) }