-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(minotaur): add hooks for HTTP server customization
Extend the Http function in the minotaur transport network with hooks to allow for additional customization of the HTTP server before it starts listening.This enhances the flexibility of the HTTP network setup without altering the core functionality.
- Loading branch information
1 parent
7d6abf8
commit b6334f6
Showing
6 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
module login | ||
|
||
go 1.22.0 | ||
|
||
require github.com/kercylan98/minotaur v0.0.0 | ||
|
||
require ( | ||
github.com/RussellLuo/timingwheel v0.0.0-20220218152713-54845bda3108 // indirect | ||
github.com/armon/go-metrics v0.4.1 // indirect | ||
github.com/fatih/color v1.16.0 // indirect | ||
github.com/gobwas/httphead v0.1.0 // indirect | ||
github.com/gobwas/pool v0.2.1 // indirect | ||
github.com/gobwas/ws v1.4.0 // indirect | ||
github.com/google/btree v1.1.2 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 // indirect | ||
github.com/hashicorp/errwrap v1.1.0 // indirect | ||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect | ||
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect | ||
github.com/hashicorp/go-multierror v1.1.1 // indirect | ||
github.com/hashicorp/go-sockaddr v1.0.6 // indirect | ||
github.com/hashicorp/golang-lru v1.0.2 // indirect | ||
github.com/hashicorp/memberlist v0.5.1 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect | ||
github.com/klauspost/reedsolomon v1.12.1 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/miekg/dns v1.1.61 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/panjf2000/gnet/v2 v2.5.2 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/samber/do/v2 v2.0.0-beta.5 // indirect | ||
github.com/samber/go-type-to-string v1.2.0 // indirect | ||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect | ||
github.com/templexxx/cpu v0.1.0 // indirect | ||
github.com/templexxx/xorsimd v0.4.2 // indirect | ||
github.com/tjfoc/gmsm v1.4.1 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/xtaci/kcp-go/v5 v5.6.8 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.27.0 // indirect | ||
golang.org/x/crypto v0.24.0 // indirect | ||
golang.org/x/mod v0.18.0 // indirect | ||
golang.org/x/net v0.26.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/sys v0.21.0 // indirect | ||
golang.org/x/tools v0.22.0 // indirect | ||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
) | ||
|
||
replace github.com/kercylan98/minotaur v0.0.0 => ../../../../minotaur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/kercylan98/minotaur/minotaur" | ||
"github.com/kercylan98/minotaur/minotaur/transport/network" | ||
"github.com/kercylan98/minotaur/minotaur/vivid" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
minotaur.NewApplication( | ||
minotaur.WithNetwork(network.Http(":8080", func(handler *network.HttpServe) { | ||
handler.HandleFunc("GET /login", func(w http.ResponseWriter, r *http.Request) { | ||
w.Write([]byte("Hello, World!")) | ||
}) | ||
})), | ||
minotaur.WithActorSystemName("login"), | ||
).Launch(func(app *minotaur.Application, ctx vivid.MessageContext) { | ||
app.GetServer() | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters