You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.3 KiB

  1. package caddy_tls_store
  2. import (
  3. "fmt"
  4. "github.com/caddyserver/caddy/v2"
  5. "github.com/caddyserver/certmagic"
  6. )
  7. type (
  8. ZeroStore struct {
  9. DB string `json:"db,omitempty"`
  10. }
  11. )
  12. func init() {
  13. caddy.RegisterModule(ZeroStore{})
  14. }
  15. func (ZeroStore) CaddyModule() caddy.ModuleInfo {
  16. return caddy.ModuleInfo{
  17. ID: "caddy.storage.zero_store",
  18. New: func() caddy.Module { return new(ZeroStore) },
  19. }
  20. }
  21. func (zs *ZeroStore) CertMagicStorage() (certmagic.Storage, error) {
  22. return zs, nil
  23. }
  24. func (zs *ZeroStore) Lock(key string) error {
  25. return fmt.Errorf("not yet implemented")
  26. }
  27. func (zs *ZeroStore) Unlock(key string) error {
  28. return fmt.Errorf("not yet implemented")
  29. }
  30. func (zs *ZeroStore) Store(key string, value []byte) error {
  31. return fmt.Errorf("not yet implemented")
  32. }
  33. func (zs *ZeroStore) Load(key string) ([]byte, error) {
  34. return []byte{}, fmt.Errorf("not yet implemented")
  35. }
  36. func (zs *ZeroStore) Delete(key string) error {
  37. return fmt.Errorf("not yet implemented")
  38. }
  39. func (zs *ZeroStore) Exists(key string) bool {
  40. return false
  41. }
  42. func (zs *ZeroStore) List(prefix string, recursive bool) ([]string, error) {
  43. return []string{}, fmt.Errorf("not yet implemented")
  44. }
  45. func (zs *ZeroStore) Stat(key string) (certmagic.KeyInfo, error) {
  46. return certmagic.KeyInfo{}, fmt.Errorf("not yet implemented")
  47. }
  48. var (
  49. _ caddy.StorageConverter = (*ZeroStore)(nil)
  50. )