Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorNilConnection is used when a connection is not available but needed ErrorNilConnection = errors.New("connection is nil") // ErrorObjectNotFound is used when an object is not found in DB based on given filter ErrorObjectNotFound = errors.New("object not found") // ErrorDuplicateObject is used when a Serial Number (which is the primary id) is already in the db ErrorDuplicateObject = errors.New("object is a duplicate") )
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { Meta Status string ExpirationDate time.Time RevocationDate *time.Time NameSerialNumber string `gorm:"unique"` SerialNumber *big.Int `gorm:"unique"` CommonName string }
Certificate is the struct for the database certificate object
func NewCertificate ¶
func NewCertificate() *Certificate
NewCertificate creates a new Certificate object with a generated ID and settings the CreatedAt and UpdatedAt to now
type CertificateRepository ¶
type CertificateRepository interface { GetByNameSerialNumber(nameSerialNumber string) (*Certificate, error) Create(certificate *Certificate) error DeleteByNameSerialNumber(nameSerialNumber string) error }
CertificateRepository is the interface for certificate repository implementations
Click to show internal directories.
Click to hide internal directories.