Skip to content

Commit

Permalink
Merge pull request #25 from strvcom/chore/update-timex
Browse files Browse the repository at this point in the history
chore: update go.strv.io/time package
  • Loading branch information
Tomáš Kocman authored Jan 9, 2023
2 parents b502275 + 2baf129 commit e78b5a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ How to release a new version:

## [Unreleased]

## [0.3.0] - 2023-01-09
### Added
- HTTP response writer contains error field.

### Changed
- `LoggingMiddleware` logs `err` field with message if error is present.
- Updated packages:
```diff
- go.strv.io/time: v0.1.0
+ go.strv.io/time: v0.2.0
```

## [0.2.0] - 2022-08-22
### Added
Expand All @@ -19,6 +25,7 @@ How to release a new version:
### Added
- Added Changelog.

[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.3.0
[0.2.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.2.0
[0.1.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.1.0
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/google/uuid v1.3.0
github.com/stretchr/testify v1.8.0
go.strv.io/time v0.1.0
go.strv.io/time v0.2.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
go.strv.io/time v0.1.0 h1:Fkf3YXcnaS5Ot/UD/xMQxBbReOwkT9JogW2o9Nwdyqo=
go.strv.io/time v0.1.0/go.mod h1:B/lByAO3oACN3uLOXQaB64cKhkVIMoZjnZBhADFNbFY=
go.strv.io/time v0.2.0 h1:RgCpABq+temfp8+DLM2zqsdimnKpktOSPduUghM8ZIk=
go.strv.io/time v0.2.0/go.mod h1:B/lByAO3oACN3uLOXQaB64cKhkVIMoZjnZBhADFNbFY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
Expand Down
11 changes: 6 additions & 5 deletions http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ func NewServer(config *ServerConfig) *Server {
doBeforeShutdown: config.Hooks.BeforeShutdown,
}
if to := config.Limits.Timeouts; to != nil {
s.server.ReadTimeout = to.ReadTimeout.Duration
s.server.ReadHeaderTimeout = to.ReadHeaderTimeout.Duration
s.server.WriteTimeout = to.WriteTimeout.Duration
s.server.IdleTimeout = to.IdleTimeout.Duration
s.server.ReadTimeout = to.ReadTimeout.Duration()
s.server.ReadHeaderTimeout = to.ReadHeaderTimeout.Duration()
s.server.WriteTimeout = to.WriteTimeout.Duration()
s.server.IdleTimeout = to.IdleTimeout.Duration()

if to.ShutdownTimeout != nil {
s.shutdownTimeout = &to.ShutdownTimeout.Duration
d := to.ShutdownTimeout.Duration()
s.shutdownTimeout = &d
}
}

Expand Down

0 comments on commit e78b5a6

Please sign in to comment.