Documentation
¶
Overview ¶
Package etcdstorage is a Caddy storage module that keeps certificates, keys and the other assets Caddy manages in etcd, so that several Caddy instances can share them.
Under the configured prefix, values live below <prefix>/data/ and locks below <prefix>/locks/. Keys are certmagic's slash-separated paths. A "directory" is any key prefix that ends at a slash, and it exists while some key lies below it.
Locks are etcd mutexes held on leases. Waiters are served first come, first served; a held lock is kept alive by the client; and if its holder dies, the lease expires and takes the lock with it.
Index ¶
- type Storage
- func (*Storage) CaddyModule() caddy.ModuleInfo
- func (s *Storage) CertMagicStorage() (certmagic.Storage, error)
- func (s *Storage) Cleanup() error
- func (s *Storage) Delete(ctx context.Context, key string) error
- func (s *Storage) Exists(ctx context.Context, key string) bool
- func (s *Storage) List(ctx context.Context, dir string, recursive bool) ([]string, error)
- func (s *Storage) Load(ctx context.Context, key string) ([]byte, error)
- func (s *Storage) Lock(ctx context.Context, name string) error
- func (s *Storage) Provision(ctx caddy.Context) error
- func (s *Storage) Stat(ctx context.Context, key string) (certmagic.KeyInfo, error)
- func (s *Storage) Store(ctx context.Context, key string, value []byte) error
- func (s *Storage) String() string
- func (s *Storage) Unlock(_ context.Context, name string) error
- func (s *Storage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// Endpoints are the etcd members to talk to, as host:port or URLs.
Endpoints []string `json:"endpoints,omitempty"`
// Prefix is the etcd key prefix this module owns. Default: /caddy.
Prefix string `json:"prefix,omitempty"`
// contains filtered or unexported fields
}
Storage is the caddy.storage.etcd module.
func (*Storage) CaddyModule ¶
func (*Storage) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Storage) CertMagicStorage ¶
CertMagicStorage returns the module itself: it is the storage.
func (*Storage) Cleanup ¶
Cleanup releases the locks this instance still holds and disconnects. Caddy calls it when the config that loaded the module is unloaded.
func (*Storage) List ¶
List returns the entries directly below dir, keys and directories, or, if recursive, every key below it.