github.com/abolfazlbeh/zhycan@v0.0.0-20230819144214-24cf38237387/internal/http/types.go (about)

     1  package http
     2  
     3  import "github.com/gofiber/fiber/v2"
     4  
     5  type ServerConfig struct {
     6  	ListenAddress string   `json:"addr"`
     7  	Name          string   `json:"name"`
     8  	Versions      []string `json:"versions"`
     9  	SupportStatic bool     `json:"support_static"`
    10  	Config        struct {
    11  		ServerHeader         string   `json:"server_header"`
    12  		StrictRouting        bool     `json:"strict_routing"`
    13  		CaseSensitive        bool     `json:"case_sensitive"`
    14  		UnescapePath         bool     `json:"unescape_path"`
    15  		Etag                 bool     `json:"etag"`
    16  		BodyLimit            int      `json:"body_limit"`
    17  		Concurrency          int      `json:"concurrency"`
    18  		ReadTimeout          int      `json:"read_timeout"`
    19  		WriteTimeout         int      `json:"write_timeout"`
    20  		IdleTimeout          int      `json:"idle_timeout"`
    21  		ReadBufferSize       int      `json:"read_buffer_size"`
    22  		WriteBufferSize      int      `json:"write_buffer_size"`
    23  		CompressedFileSuffix string   `json:"compressed_file_suffix"`
    24  		GetOnly              bool     `json:"get_only"`
    25  		DisableKeepalive     bool     `json:"disable_keepalive"`
    26  		Network              string   `json:"network"`
    27  		EnablePrintRoutes    bool     `json:"enable_print_routes"`
    28  		AttachErrorHandler   bool     `json:"attach_error_handler"`
    29  		RequestMethods       []string `json:"request_methods"`
    30  	} `json:"conf"`
    31  	Middlewares struct {
    32  		Order []string `json:"order"`
    33  	} `json:"middlewares"`
    34  	Static struct {
    35  		Prefix string       `json:"prefix"`
    36  		Root   string       `json:"root"`
    37  		Config fiber.Static `json:"config"`
    38  	} `json:"static"`
    39  }
    40  
    41  // LoggerMiddlewareConfig - defines the config for middleware.
    42  type LoggerMiddlewareConfig struct {
    43  	Format       string `json:"format"`
    44  	TimeFormat   string `json:"time_format"`
    45  	TimeZone     string `json:"time_zone"`
    46  	TimeInterval int    `json:"time_interval"`
    47  	Output       string `json:"output"`
    48  }
    49  
    50  type FaviconMiddlewareConfig struct {
    51  	File         string `json:"file"`
    52  	URL          string `json:"url"`
    53  	CacheControl string `json:"cache_control"`
    54  }