Documentation
¶
Index ¶
Constants ¶
const Name = "autocache"
Name represents autocache's shorthand named.
Variables ¶
var DefaultOptions = &Options{ Addr: ":8333", Port: 8333, Scheme: "http", CacheSize: 10 << 20, Group: "default", GetterFn: func(ctx context.Context, id string, dest groupcache.Sink) error { b := fromContext(ctx) if len(b) == 0 { return fmt.Errorf("autocache: empty ctx for id: %s", id) } if err := dest.SetBytes(b); err != nil { return fmt.Errorf("autocache: sink error %w", err) } return nil }, }
DefaultOptions are the default options used by the autocache service.
Functions ¶
Types ¶
type Options ¶
type Options struct { Addr string CacheSize int64 ClusterDomain string GetterFn groupcache.GetterFunc Group string Log *stdlog.Logger Port int Scheme string }
Options represent autocache options.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a the store interface for autocache, a distributed cache with gossip based peer membership enrollment. https://github.com/pomerium/autocache
func New ¶
New creates a new autocache key value store. Autocache will start several services to support distributed cluster management and membership. A HTTP server will be used by groupcache to perform cross node-RPC. By default that server will start on port “:8333`. Memberlist will likewise start and listen for group membership on port
NOTE: RPC communication between nodes is _authenticated_ but not encrypted. NOTE: Groupchache starts a HTTP listener (Default: :8333) NOTE: Memberlist starts a GOSSIP listener on TCP/UDP. (Default: :7946)
func (Store) Close ¶
Close shuts down any HTTP server used for groupcache pool, and also stop any background maintenance of memberlist.