|
@@ -0,0 +1,299 @@
|
|
|
+###################################################
|
|
|
+# benchmark - aah framework application
|
|
|
+#
|
|
|
+# Complete configuration reference:
|
|
|
+# https://docs.aahframework.org/app-config.html
|
|
|
+###################################################
|
|
|
+
|
|
|
+# Application name (non-whitespace)
|
|
|
+# Default value is `basename` of import path.
|
|
|
+name = "benchmark"
|
|
|
+
|
|
|
+# Friendly description of application
|
|
|
+desc = "aah framework web application"
|
|
|
+
|
|
|
+# -----------------------------------------------------------------
|
|
|
+# Server configuration - HTTP
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-server
|
|
|
+# -----------------------------------------------------------------
|
|
|
+server {
|
|
|
+ # For unix socket: unix:/tmp/aahframework.sock
|
|
|
+ # Default value is `empty` string.
|
|
|
+ #address = ""
|
|
|
+
|
|
|
+ # For port `80` and `443`, put empty string or a value
|
|
|
+ # Default value is 8080.
|
|
|
+ #port = ""
|
|
|
+
|
|
|
+ # Valid time units are "s = seconds", "m = minutes"
|
|
|
+ timeout {
|
|
|
+ # mapped to `http.Server.ReadTimeout`.
|
|
|
+ # Default value is `90s`.
|
|
|
+ #read = "90s"
|
|
|
+
|
|
|
+ # mapped to `http.Server.WriteTimeout`
|
|
|
+ # Default value is `90s`.
|
|
|
+ #write = "90s"
|
|
|
+
|
|
|
+ # aah sever graceful shutdown timeout
|
|
|
+ # Note: applicable only to go1.8 and above
|
|
|
+ # Default value is `60s`.
|
|
|
+ #grace_shutdown = "60s"
|
|
|
+ }
|
|
|
+
|
|
|
+ # Mapped to `http.Server.MaxHeaderBytes`.
|
|
|
+ # Default value is `1mb`.
|
|
|
+ #max_header_bytes = "1mb"
|
|
|
+
|
|
|
+ # HTTP server keep alive option.
|
|
|
+ # Default value is `true`.
|
|
|
+ #keep_alive = true
|
|
|
+
|
|
|
+ ssl {
|
|
|
+ # Default value is `false`.
|
|
|
+ #enable = false
|
|
|
+
|
|
|
+ # Default value is `empty` string.
|
|
|
+ #cert = ""
|
|
|
+
|
|
|
+ # Default value is `empty` string.
|
|
|
+ #key = ""
|
|
|
+
|
|
|
+ # Disabling HTTP/2 set it true.
|
|
|
+ # Default value is `false`.
|
|
|
+ #disable_http2 = true
|
|
|
+
|
|
|
+ lets_encrypt {
|
|
|
+ # To get SSL certificate from Let's Encrypt CA, enable it.
|
|
|
+ # Don't forget to enable `server.ssl.enable=true`.
|
|
|
+ # Default value is `false`.
|
|
|
+ #enable = false
|
|
|
+
|
|
|
+ # Host policy controls which domains the autocert will attempt
|
|
|
+ # to retrieve new certificates for. It does not affect cached certs.
|
|
|
+ # It is required, no default value.
|
|
|
+ #host_policy = ["example.org", "docs.example.org"]
|
|
|
+
|
|
|
+ # Renew before optionally specifies how early certificates should
|
|
|
+ # be renewed before they expire.
|
|
|
+ # Default value is `10` days.
|
|
|
+ #renew_before = 10
|
|
|
+
|
|
|
+ # Email optionally specifies a contact email address. This is used by CAs,
|
|
|
+ # such as Let's Encrypt, to notify about problems with issued certificates.
|
|
|
+ # If the Client's account key is already registered, Email is not used.
|
|
|
+ #email = "[email protected]"
|
|
|
+
|
|
|
+ # Force RSA makes the autocert generate certificates with 2048-bit RSA keys.
|
|
|
+ # If false, a default is used. Currently the default is
|
|
|
+ # EC-based keys using the P-256 curve.
|
|
|
+ #force_rsa = false
|
|
|
+
|
|
|
+ # Cache optionally stores and retrieves previously-obtained certificates
|
|
|
+ # autocert manager. By default certs will only be cached for the lifetime
|
|
|
+ # of the autocert manager.
|
|
|
+ #
|
|
|
+ # autocert manager passes the Cache certificates data encoded in PEM,
|
|
|
+ # with private/public parts combined in a single Cache.Put call,
|
|
|
+ # private key first.
|
|
|
+ # Default value is `empty` string
|
|
|
+ #cache_dir = "/Users/jeeva/autocert"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+# ------------------------------------------------------------------
|
|
|
+# Request configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-request
|
|
|
+# ------------------------------------------------------------------
|
|
|
+request {
|
|
|
+
|
|
|
+ # aah framework encourages to have unique `Request Id` for each incoming
|
|
|
+ # request, it helps in traceability. If request has already `X-Request-Id`
|
|
|
+ # HTTP header then it does not generate one.
|
|
|
+ id {
|
|
|
+ # Default value is `true`.
|
|
|
+ enable = false
|
|
|
+
|
|
|
+ # Default value is `X-Request-Id`, change it if you have different one.
|
|
|
+ #header = "X-Request-Id"
|
|
|
+ }
|
|
|
+
|
|
|
+ # Default value is `32mb`, choose your value based on your use case
|
|
|
+ #multipart_size = "32mb"
|
|
|
+}
|
|
|
+
|
|
|
+# ---------------------------------------------------------------
|
|
|
+# i18n configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-i18n
|
|
|
+# ---------------------------------------------------------------
|
|
|
+i18n {
|
|
|
+ # It is used as fallback if framework is unable to determine the
|
|
|
+ # locale from HTTP Request.
|
|
|
+ # Default value is `en`.
|
|
|
+ #default = "en"
|
|
|
+}
|
|
|
+
|
|
|
+# -----------------------------------------------------------------
|
|
|
+# Format configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-format
|
|
|
+# -----------------------------------------------------------------
|
|
|
+format {
|
|
|
+ # Default value is `2006-01-02`.
|
|
|
+ #date = "2006-01-02"
|
|
|
+
|
|
|
+ # Default value is `2006-01-02 15:04:05`.
|
|
|
+ #datetime = "2006-01-02 15:04:05"
|
|
|
+}
|
|
|
+
|
|
|
+# ------------------------------------------------------------------
|
|
|
+# Runtime configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-runtime
|
|
|
+# ------------------------------------------------------------------
|
|
|
+runtime {
|
|
|
+ debug {
|
|
|
+ # Choose an appropriate buffer size for collecting all goroutines stack trace
|
|
|
+ # dump based on your case.
|
|
|
+ # Default value is `2mb`.
|
|
|
+ #stack_buffer_size = "2mb"
|
|
|
+
|
|
|
+ # Whether to collect all the Go routines details or not.
|
|
|
+ # Default value is `false`.
|
|
|
+ #all_goroutines = true
|
|
|
+ }
|
|
|
+
|
|
|
+ # Pooling configuration is to reduce GC overhead from framework.
|
|
|
+ # Tune these value based on your use case. Pool doesn't create object
|
|
|
+ # unless it's needed.
|
|
|
+ # Doc: https://docs.aahframework.org/pooling.html
|
|
|
+ pooling {
|
|
|
+ # Default value is `500`.
|
|
|
+ global = 5000
|
|
|
+
|
|
|
+ # Used for `bytes.Buffer`
|
|
|
+ # Default value is `200`.
|
|
|
+ buffer = 1500
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+# -----------------------------------------------------------------
|
|
|
+# Render configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-render
|
|
|
+# -----------------------------------------------------------------
|
|
|
+render {
|
|
|
+ # aah framework chooses the `Content-Type` value automatically based on
|
|
|
+ # configuration if `aah.Reply()` builder value is not set. It selects in
|
|
|
+ # the order of:
|
|
|
+ # - Based on URL file extension, supported `.html`, `.htm`, `.json`, `.js`, `.xml` and `.txt`
|
|
|
+ # - Request Accept Header - Most Qualified one as per RFC7321
|
|
|
+ # - Based `render.default` value supported types are `html`, `json`, `xml` and `text`
|
|
|
+ # - Finally aah framework uses `http.DetectContentType` API
|
|
|
+ # Default value is `empty` string.
|
|
|
+ default = "html"
|
|
|
+
|
|
|
+ # Pretty print option is helpful in `dev` environment profile.
|
|
|
+ # It is only applicable to JSON and XML.
|
|
|
+ # Default value is `false`.
|
|
|
+ #pretty = true
|
|
|
+
|
|
|
+ # Gzip compression configuration for HTTP response.
|
|
|
+ gzip {
|
|
|
+ # By default Gzip compression is enabled in aah framework, however
|
|
|
+ # framework ensures HTTP client accepts Gzip response otherwise
|
|
|
+ # it won't use Gzip compression.
|
|
|
+ #
|
|
|
+ # Tips: If you have nginx or apache web server enabled with gzip in-front
|
|
|
+ # of aah server the set this value to `false`.
|
|
|
+ #
|
|
|
+ # Default value is `true`.
|
|
|
+ enable = false
|
|
|
+
|
|
|
+ # Used to control Gzip compression levels. Valid levels are
|
|
|
+ # 1 = BestSpeed to 9 = BestCompression.
|
|
|
+ # Default value is `4`.
|
|
|
+ #level = 4
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+# ------------------------------------------------------------------
|
|
|
+# Cache configuration
|
|
|
+# Doc: https://docs.aahframework.org/static-files.html#cache-control
|
|
|
+# ------------------------------------------------------------------
|
|
|
+cache {
|
|
|
+ static {
|
|
|
+ # Default `Cache-Control` for all static files,
|
|
|
+ # if specific mime type is not defined.
|
|
|
+ default_cache_control = "public, max-age=31536000"
|
|
|
+
|
|
|
+ # Define by mime types, if mime is not present then default is applied.
|
|
|
+ # Config is very flexible to define by mime type.
|
|
|
+ #
|
|
|
+ # Create a unique name and provide `mime` with comma separated value
|
|
|
+ # and `cache_control`.
|
|
|
+ # mime_types {
|
|
|
+ # css_js {
|
|
|
+ # mime = "text/css, application/javascript"
|
|
|
+ # cache_control = "public, max-age=604800, proxy-revalidate"
|
|
|
+ # }
|
|
|
+ #
|
|
|
+ # images {
|
|
|
+ # mime = "image/jpeg, image/png, image/gif, image/svg+xml, image/x-icon"
|
|
|
+ # cache_control = "public, max-age=2628000, proxy-revalidate"
|
|
|
+ # }
|
|
|
+ # }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+# ---------------------------------------------------------------
|
|
|
+# View configuration
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-view
|
|
|
+# ---------------------------------------------------------------
|
|
|
+view {
|
|
|
+ # Choosing view engine for application. In the upcoming release framework
|
|
|
+ # will provide support to amber, pongo2, and jade. However you can implement
|
|
|
+ # on your own with simple `view.Enginer` interface.
|
|
|
+ # Default value is `go`. Currently only `go` is supported.
|
|
|
+ #engine = "go"
|
|
|
+
|
|
|
+ # Choose your own view file extension.
|
|
|
+ # Default value is `.html`.
|
|
|
+ #ext = ".html"
|
|
|
+
|
|
|
+ # Choose whether you need a case sensitive view file resolve or not.
|
|
|
+ # For e.g.: "/views/pages/app/login.tmpl" == "/views/pages/App/Login.tmpl"
|
|
|
+ # Default value is `false`.
|
|
|
+ #case_sensitive = false
|
|
|
+
|
|
|
+ # To use custom Go template delimiters for view files.
|
|
|
+ # Default value is `{{.}}`.
|
|
|
+ #delimiters = "{{.}}"
|
|
|
+
|
|
|
+ # Framework chooses the default app layout as `master.html` if you do not
|
|
|
+ # provide one. However you may have pages or template without layout too.
|
|
|
+ # So option to disable the default layout for HTML.
|
|
|
+ # Default value is `true`. Available since v0.6
|
|
|
+ #default_layout = false
|
|
|
+}
|
|
|
+
|
|
|
+# DataSource config
|
|
|
+datasource {
|
|
|
+ benchmark {
|
|
|
+ driver = "mysql"
|
|
|
+ url = "benchmarkdbuser:benchmarkdbpass@tcp(%s:3306)/hello_world"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+# --------------------------------------------------------------
|
|
|
+# Environment Profiles e.g.: dev, qa, prod
|
|
|
+# Doc: https://docs.aahframework.org/app-config.html#section-env
|
|
|
+# --------------------------------------------------------------
|
|
|
+env {
|
|
|
+ # Indicates active profile name for application configuration.
|
|
|
+ # Default value is `dev`.
|
|
|
+ #active = "dev"
|
|
|
+
|
|
|
+ # ----------------------------------
|
|
|
+ # Environment profile configurations
|
|
|
+ # ----------------------------------
|
|
|
+ include "./env/*.conf"
|
|
|
+}
|