Use new router version

This commit is contained in:
some 2024-10-08 20:50:05 -04:00
parent 0ea4adb96c
commit df289d1e35
Signed by: some
GPG Key ID: 65D0589220B9BFC8
5 changed files with 10 additions and 10 deletions

2
go.mod
View File

@ -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 (

4
go.sum
View File

@ -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=

View File

@ -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)
}

View File

@ -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:

View File

@ -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)
}