Skip to content

Latest commit

 

History

History
89 lines (76 loc) · 1.78 KB

configuration.md

File metadata and controls

89 lines (76 loc) · 1.78 KB

Configuration

Gomods has a set of default values for the config options and you can use it by only adding the plugin name inside your config file.

Here is a example in Caddyfile format:

gomods.test {
  gomods
}

Config Options

General options:

  • gobinary: string - Path to the Go binary (Default: /usr/bin/go)
  • workers: integer - Number of workers for fetching the modules (Default: 1)
  • cache: object - Cache configuration object

Cache options:

  • type: string - Cache storage type (Default: tmp, Options: [local, tmp])
  • path: string - Cache storage path (Default: /tmp)

Examples

Caddyfile Example:

gomods.test {
  gomods {
		gobinary /my/go/binary
		workers 5
		cache {
			type local
			path /my/cache/path
		}
	}
}

JSON Example:

{
  "apps": {
    "http": {
      "servers": {
        "srv0": {
          "listen": [":443"],
          "routes": [
            {
              "match": [
                {
                  "host": ["gomods.test"]
                }
              ],
              "handle": [
                {
                  "handler": "subroute",
                  "routes": [
                    {
                      "handle": [
                        {
                          "Config": {
                            "cache": {
                              "path": "/my/cache/path",
                              "type": "local"
                            },
                            "gobinary": "/my/go/binary",
                            "workers": 5
                          },
                          "handler": "gomods"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    }
  }
}