Skip to content

Commit f9acf99

Browse files
committed
update doc strings
1 parent e52c9e9 commit f9acf99

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
)
3131

3232
const (
33-
version = "v0.0.16"
33+
version = "v0.0.17"
3434
)
3535

3636
var (

internal/server/auth.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@ import (
66
"github.com/rs/zerolog/log"
77
)
88

9-
// ApiTokenMiddleware checks for the presence and validity of the API token.
9+
// ApiTokenMiddleware is a middleware function that checks for the presence and validity of the API token.
10+
//
11+
// Parameters:
12+
// - next: http.HandlerFunc
13+
// The next HTTP handler in the chain.
14+
// - token: string
15+
// The expected API token for authentication.
16+
//
17+
// Behavior:
18+
//
19+
// The middleware checks the 'X-API-Token' header in the incoming request against the provided token.
20+
// If the header is missing or the token is invalid, it responds with an HTTP 401 Unauthorized status.
21+
// If the token is valid, it calls the next handler in the chain.
1022
func ApiTokenMiddleware(next http.HandlerFunc, token string) http.HandlerFunc {
1123
return func(w http.ResponseWriter, r *http.Request) {
1224
apiToken := r.Header.Get("X-API-Token")

internal/server/server.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/rs/zerolog/log"
1515
)
1616

17+
// StaticFS is the embedded filesystem for static files.
1718
var StaticFS embed.FS
1819

1920
// Run starts the HTTP server.

0 commit comments

Comments
 (0)