mirror of
https://github.com/safing/portbase
synced 2025-09-09 13:55:47 +00:00
Implement review suggestions
This commit is contained in:
parent
40c2849bab
commit
ab05924bcf
4 changed files with 17 additions and 15 deletions
|
@ -11,6 +11,16 @@ import (
|
|||
)
|
||||
|
||||
func registerDebugEndpoints() error {
|
||||
if err := RegisterEndpoint(Endpoint{
|
||||
Path: "ping",
|
||||
Read: PermitAnyone,
|
||||
ActionFunc: ping,
|
||||
Name: "Ping",
|
||||
Description: "Pong.",
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := RegisterEndpoint(Endpoint{
|
||||
Path: "debug/stack",
|
||||
Read: PermitAnyone,
|
||||
|
@ -50,6 +60,11 @@ func registerDebugEndpoints() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ping responds with pong.
|
||||
func ping(ar *Request) (msg string, err error) {
|
||||
return "Pong.", nil
|
||||
}
|
||||
|
||||
// getStack returns the current goroutine stack.
|
||||
func getStack(_ *Request) (data []byte, err error) {
|
||||
buf := &bytes.Buffer{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue