cqlstorage

package module
v0.0.0-...-9bd6de8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 15 Imported by: 0

README

cassandra-caddy-storage

A Caddy Storage Plugin for using Cassandra

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorage

func NewStorage(cfg CQLStorage) (certmagic.Storage, error)

Types

type CQLStorage

type CQLStorage struct {
	QueryTimeout  SecondsDuration `json:"query_timeout,omitempty"`
	LockTimeout   SecondsDuration `json:"lock_timeout,omitempty"`
	ContactPoints []string        `json:"contact_points,omitempty"`
	Keyspace      string          `json:"keyspace,omitempty"`
	Username      string          `json:"username,omitempty"`
	Password      string          `json:"password,omitempty"`
	// contains filtered or unexported fields
}

CQLStorage implements both JSON and Caddyfile configuration. When configured via Caddyfile, UnmarshalCaddyfile is invoked; when configured via JSON, the fields are filled by the JSON adapter, and Provision applies common defaults.

func (CQLStorage) CaddyModule

func (CQLStorage) CaddyModule() caddy.ModuleInfo

func (*CQLStorage) CertMagicStorage

func (cs *CQLStorage) CertMagicStorage() (certmagic.Storage, error)

func (*CQLStorage) Delete

func (cs *CQLStorage) Delete(ctx context.Context, key string) error

func (*CQLStorage) Exists

func (cs *CQLStorage) Exists(ctx context.Context, key string) bool

func (*CQLStorage) List

func (cs *CQLStorage) List(ctx context.Context, prefix string, recursive bool) ([]string, error)

func (*CQLStorage) Load

func (cs *CQLStorage) Load(ctx context.Context, key string) ([]byte, error)

func (*CQLStorage) Lock

func (cs *CQLStorage) Lock(ctx context.Context, key string) error

func (*CQLStorage) Provision

func (cs *CQLStorage) Provision(ctx caddy.Context) error

Provision applies default values and falls back to environment variables when necessary. This method is invoked regardless of the configuration source.

func (*CQLStorage) Stat

func (cs *CQLStorage) Stat(ctx context.Context, key string) (certmagic.KeyInfo, error)

func (*CQLStorage) Store

func (cs *CQLStorage) Store(ctx context.Context, key string, value []byte) error

func (*CQLStorage) Unlock

func (cs *CQLStorage) Unlock(ctx context.Context, key string) error

func (*CQLStorage) UnmarshalCaddyfile

func (cs *CQLStorage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile is called only when using the Caddyfile adapter.

func (*CQLStorage) Validate

func (cs *CQLStorage) Validate() error

type SecondsDuration

type SecondsDuration time.Duration

SecondsDuration is a custom duration type that supports configuration as a plain number (interpreted as seconds) or as a duration string (e.g., "3s").

func (SecondsDuration) MarshalJSON

func (d SecondsDuration) MarshalJSON() ([]byte, error)

MarshalJSON marshals the duration as a string.

func (*SecondsDuration) UnmarshalJSON

func (d *SecondsDuration) UnmarshalJSON(b []byte) error

UnmarshalJSON supports both number (in seconds) and string (e.g., "3s") formats.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL