pages-server/server/database/interface.go

24 lines
579 B
Go
Raw Normal View History

2021-12-03 04:15:48 +01:00
package database
2021-12-05 19:00:57 +01:00
import (
"github.com/akrylysov/pogreb"
"github.com/go-acme/lego/v4/certificate"
)
2021-12-03 04:15:48 +01:00
2021-12-05 17:42:53 +01:00
type CertDB interface {
Close() error
2021-12-05 19:00:57 +01:00
Put(name string, cert *certificate.Resource) error
Get(name string) (*certificate.Resource, error)
Delete(key string) error
Compact() (string, error)
2021-12-03 04:15:48 +01:00
Items() *pogreb.ItemIterator
}
2023-02-09 15:19:16 +01:00
type Cert struct {
Domain string `xorm:"pk NOT NULL"`
Created int64 `xorm:"created NOT NULL DEFAULT 0"`
Updated int64 `xorm:"updated NOT NULL DEFAULT 0"`
ValidTill int64 `xorm:"NOT NULL DEFAULT 0"`
Raw []byte `xorm:"NOT NULL"`
}