Documentation
¶
Index ¶
- Variables
- type PostgresStorage
- func (PostgresStorage) CaddyModule() caddy.ModuleInfo
- func (p *PostgresStorage) CertMagicStorage() (certmagic.Storage, error)
- func (p *PostgresStorage) Cleanup() error
- func (p *PostgresStorage) Provision(ctx caddy.Context) error
- func (p *PostgresStorage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (p *PostgresStorage) Validate() error
- type Storage
- 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, name string) error
- func (s *Storage) RenewLockLease(ctx context.Context, name string, leaseDuration time.Duration) 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) TryLock(ctx context.Context, name string) (bool, error)
- func (s *Storage) Unlock(ctx context.Context, name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLockNotHeld indicates that this Storage instance does not own the lock. ErrLockNotHeld = errors.New("lock is not held by this storage instance") // ErrLockLost indicates that the database lease is no longer owned by this instance. ErrLockLost = errors.New("lock lease was lost") // ErrStorageClosed indicates that the module has started cleanup. ErrStorageClosed = errors.New("storage is closed") )
Functions ¶
This section is empty.
Types ¶
type PostgresStorage ¶
type PostgresStorage struct {
DatabaseURL string `json:"database_url,omitempty"`
Schema string `json:"schema,omitempty"`
AutoCreate *bool `json:"auto_create,omitempty"`
MaxOpenConns int `json:"max_open_conns,omitempty"`
MaxIdleConns int `json:"max_idle_conns,omitempty"`
ConnMaxLifetime caddy.Duration `json:"conn_max_lifetime,omitempty"`
OperationTimeout caddy.Duration `json:"operation_timeout,omitempty"`
LockTTL caddy.Duration `json:"lock_ttl,omitempty"`
LockPollInterval caddy.Duration `json:"lock_poll_interval,omitempty"`
// contains filtered or unexported fields
}
PostgresStorage is the Caddy module that exposes PostgreSQL as CertMagic storage.
func (PostgresStorage) CaddyModule ¶
func (PostgresStorage) CaddyModule() caddy.ModuleInfo
func (*PostgresStorage) CertMagicStorage ¶
func (p *PostgresStorage) CertMagicStorage() (certmagic.Storage, error)
func (*PostgresStorage) Cleanup ¶
func (p *PostgresStorage) Cleanup() error
func (*PostgresStorage) UnmarshalCaddyfile ¶
func (p *PostgresStorage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile parses the postgres storage module.
Syntax:
storage postgres {
database_url {$DATABASE_URL}
schema public
auto_create true
max_open_conns 10
max_idle_conns 2
conn_max_lifetime 30m
operation_timeout 10s
lock_ttl 5m
lock_poll_interval 1s
}
func (*PostgresStorage) Validate ¶
func (p *PostgresStorage) Validate() error
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements certmagic.Storage on top of PostgreSQL. It is safe for concurrent use by multiple goroutines and by multiple process instances.
func (*Storage) RenewLockLease ¶
Click to show internal directories.
Click to hide internal directories.