mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-20 09:30:29 +00:00
refactor: http interfaces (#114)
* implement custom http handler interface * implement trace_id * normalize http method spacing for consistent logs * fix failing test * fix linter errors * cleanup old dead code * more route cleanup * cleanup some inconsistent errors * update and generate code * make taskfile more consistent * update task calls * run tidy * drop `@` tag for version * use relative paths * tidy * fix auto-setting variables * update build paths * add contributing guide * tidy
This commit is contained in:
parent
e2d93f8523
commit
6529549289
40 changed files with 984 additions and 808 deletions
|
@ -12,8 +12,11 @@ import (
|
|||
func testServer(t *testing.T, r http.Handler) *Server {
|
||||
svr := NewServer(WithHost("127.0.0.1"), WithPort("19245"))
|
||||
|
||||
if r != nil {
|
||||
svr.mux.Mount("/", r)
|
||||
}
|
||||
go func() {
|
||||
err := svr.Start(r)
|
||||
err := svr.Start()
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
|
||||
|
@ -42,7 +45,7 @@ func Test_ServerShutdown_Error(t *testing.T) {
|
|||
func Test_ServerStarts_Error(t *testing.T) {
|
||||
svr := testServer(t, nil)
|
||||
|
||||
err := svr.Start(nil)
|
||||
err := svr.Start()
|
||||
assert.ErrorIs(t, err, ErrServerAlreadyStarted)
|
||||
|
||||
err = svr.Shutdown("test")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue