From 95ed603de79c66ff76bfe7e42986a2fc8c7a1fa4 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 23 Dec 2019 12:45:35 -0700 Subject: Improve godocs all around These will be used in the new automated documentation system --- modules/caddyhttp/httpcache/httpcache.go | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'modules/caddyhttp/httpcache/httpcache.go') diff --git a/modules/caddyhttp/httpcache/httpcache.go b/modules/caddyhttp/httpcache/httpcache.go index 81f5816..f8bdde8 100644 --- a/modules/caddyhttp/httpcache/httpcache.go +++ b/modules/caddyhttp/httpcache/httpcache.go @@ -33,11 +33,33 @@ func init() { } // Cache implements a simple distributed cache. +// +// NOTE: This module is a work-in-progress. It is +// not finished and is NOT ready for production use. +// [We need your help to finish it! Please volunteer +// in this issue.](https://github.com/caddyserver/caddy/issues/2820) +// Until it is finished, this module is subject to +// breaking changes. +// +// Caches only GET and HEAD requests. Honors the Cache-Control: no-cache header. +// +// Still TODO: +// +// - Eviction policies and API +// - Use single cache per-process +// - Preserve cache through config reloads +// - More control over what gets cached type Cache struct { - Self string `json:"self,omitempty"` - Peers []string `json:"peers,omitempty"` - MaxSize int64 `json:"max_size,omitempty"` - group *groupcache.Group + // The network address of this cache instance; required. + Self string `json:"self,omitempty"` + + // A list of network addresses of cache instances in the group. + Peers []string `json:"peers,omitempty"` + + // Maximum size of the cache, in bytes. Default is 512 MB. + MaxSize int64 `json:"max_size,omitempty"` + + group *groupcache.Group } // CaddyModule returns the Caddy module information. -- cgit v1.2.3