Documentation
¶
Index ¶
- type Config
- 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, prefix string, recursive bool) ([]string, error)
- func (s *Storage) Load(ctx context.Context, key string) ([]byte, error)
- func (s *Storage) Lock(ctx context.Context, key 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) Unlock(ctx context.Context, key string) error
- func (s *Storage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (s *Storage) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Addr string `json:"addr.omitempty"`
Token string `json:"token,omitempty"`
KeyPrefix string `json:"key_prefix,omitempty"`
}
Config is the configuration for consul storage
type Storage ¶
type Storage struct {
Client *api.Client
KV *api.KV
Config *Config
// contains filtered or unexported fields
}
Storage implements the certmagic storage's interface This holds the consul client and kv store
func (Storage) CaddyModule ¶
func (Storage) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information
func (*Storage) CertMagicStorage ¶
CertMagicStorage transforms storage to certmagic.Storage
func (*Storage) Delete ¶
Delete deletes key. An error should be returned only if the key still exists when the method returns.
func (*Storage) List ¶
List returns all keys that match prefix. If recursive is true, non-terminal keys will be enumerated (i.e. "directories" should be walked); otherwise, only keys prefixed exactly by prefix will be listed.
func (*Storage) UnmarshalCaddyfile ¶
UnmarshalCaddyfile deserialize Caddyfile tokens into consul storage's config
storage consul {
addr
token
key_prefix
}