Documentation ¶
Index ¶
Constants ¶
const InvalidateURLPath = "/api/internal/cache_invalidate"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheBackend ¶
CacheBackend is both an accountserver Backend and a http.Handler that implements the replicated invalidation RPCs.
CacheBackend implements a simple in-memory cache of user objects (not resources yet), in order to reduce the database and processing load in presence of a heavily read-oriented workload. The cache is very simple, and any update to a user or its resources cause us to go back to the database backend.
User objects are kept in memory for a short while and periodically cleaned up. Memory usage thus depends on the load and is difficult to estimate in advance.
func Wrap ¶
func Wrap(b as.Backend, peers []string, tls *clientutil.TLSClientConfig) (*CacheBackend, error)
Wrap a Backend with a cache.
func (*CacheBackend) NewTransaction ¶
func (b *CacheBackend) NewTransaction() (as.TX, error)
NewTransaction returns a new accountserver.TX unit-of-work object.
type InvalidateUserRequest ¶
type InvalidateUserRequest struct {
Username string `json:"username"`
}