Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
func NewServer ¶
func NewServer(options *ServerOptions) (*Server, error)
NewServer creates a new server instance
type ServerOptions ¶
type ServerOptions struct {
Port int `json:"port"`
DBPath string `json:"dbPath"`
LogLevel string `json:"logLevel"`
EnablePprof bool `json:"enablePprof"`
MetricsPort int `json:"metricsPort"`
RateLimit int `json:"rateLimit"`
EnableCORS bool `json:"enableCORS"`
CORSOrigins []string `json:"corsOrigins"`
ReadTimeout time.Duration `json:"readTimeout"`
WriteTimeout time.Duration `json:"writeTimeout"`
}
ServerOptions contains the options for the server
func NewServerOptions ¶
func NewServerOptions() *ServerOptions
NewServerOptions creates a new ServerOptions with default values
func (*ServerOptions) AddFlags ¶
func (o *ServerOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags to the given FlagSet
func (*ServerOptions) Complete ¶
func (o *ServerOptions) Complete() error
Complete completes the options
func (*ServerOptions) Validate ¶
func (o *ServerOptions) Validate() error
Validate validates the options
Click to show internal directories.
Click to hide internal directories.