Skip to content

Commit

Permalink
updating comments based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
james-prysm committed Sep 3, 2024
1 parent 31776b6 commit 72dddf2
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions api/server/httprest/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,18 @@ import (
"github.com/gorilla/mux"
)

// Option --.
// Option is a http rest server functional parameter type.
type Option func(g *Server) error

// WithMuxHandler --.
func WithMuxHandler(m httpHandler) Option {
return func(g *Server) error {
g.cfg.handler = m
return nil
}
}

// WithHTTPAddr --.
// WithHTTPAddr sets the full address ( host and port ) of the server.
func WithHTTPAddr(addr string) Option {
return func(g *Server) error {
g.cfg.httpAddr = addr
return nil
}
}

// WithRouter --.
// WithRouter sets the internal router of the server, this is required.
func WithRouter(r *mux.Router) Option {
return func(g *Server) error {
g.cfg.router = r
Expand Down

0 comments on commit 72dddf2

Please sign in to comment.