66 řádky
1.3 KiB
Go
66 řádky
1.3 KiB
Go
package caddy_tls_store
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/caddyserver/caddy/v2"
|
|
"github.com/caddyserver/certmagic"
|
|
)
|
|
|
|
type (
|
|
ZeroStore struct {
|
|
DB string `json:"db,omitempty"`
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
caddy.RegisterModule(ZeroStore{})
|
|
}
|
|
|
|
func (ZeroStore) CaddyModule() caddy.ModuleInfo {
|
|
return caddy.ModuleInfo{
|
|
ID: "caddy.storage.zero_store",
|
|
New: func() caddy.Module { return new(ZeroStore) },
|
|
}
|
|
}
|
|
|
|
func (zs *ZeroStore) CertMagicStorage() (certmagic.Storage, error) {
|
|
return zs, nil
|
|
}
|
|
|
|
func (zs *ZeroStore) Lock(key string) error {
|
|
return fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Unlock(key string) error {
|
|
return fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Store(key string, value []byte) error {
|
|
return fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Load(key string) ([]byte, error) {
|
|
return []byte{}, fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Delete(key string) error {
|
|
return fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Exists(key string) bool {
|
|
return false
|
|
}
|
|
|
|
func (zs *ZeroStore) List(prefix string, recursive bool) ([]string, error) {
|
|
return []string{}, fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
func (zs *ZeroStore) Stat(key string) (certmagic.KeyInfo, error) {
|
|
return certmagic.KeyInfo{}, fmt.Errorf("not yet implemented")
|
|
}
|
|
|
|
var (
|
|
_ caddy.StorageConverter = (*ZeroStore)(nil)
|
|
)
|