-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add server events * fix: race condition
- Loading branch information
Showing
3 changed files
with
108 additions
and
13 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
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,41 @@ | ||
package core | ||
|
||
import ( | ||
"google.golang.org/grpc" | ||
"net" | ||
"net/http" | ||
) | ||
|
||
// OnHTTPServerStart is an event triggered when the http server is ready to serve | ||
// traffic. At this point the module is already wired up. This event is useful to | ||
// register service to service discovery. | ||
type OnHTTPServerStart struct { | ||
HTTPServer *http.Server | ||
Listener net.Listener | ||
} | ||
|
||
// OnHTTPServerShutdown is an event triggered when the http server is shutting down. | ||
// traffic. At this point The traffic can no longer reach the server, but the | ||
// database and other infrastructures are not closed yet. This event is useful | ||
// to unregister service to service discovery. | ||
type OnHTTPServerShutdown struct { | ||
HTTPServer *http.Server | ||
Listener net.Listener | ||
} | ||
|
||
// OnGRPCServerStart is an event triggered when the grpc server is ready to serve | ||
// traffic. At this point the module is already wired up. This event is useful to | ||
// register service to service discovery. | ||
type OnGRPCServerStart struct { | ||
GRPCServer *grpc.Server | ||
Listener net.Listener | ||
} | ||
|
||
// OnGRPCServerShutdown is an event triggered when the http server is shutting down. | ||
// traffic. At this point The traffic can no longer reach the server, but the | ||
// database and other infrastructures are not closed yet. This event is useful | ||
// to unregister service to service discovery. | ||
type OnGRPCServerShutdown struct { | ||
GRPCServer *grpc.Server | ||
Listener net.Listener | ||
} |
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