You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
801 B
Go
39 lines
801 B
Go
6 years ago
|
package db
|
||
|
|
||
|
import (
|
||
|
"crypto/x509"
|
||
|
|
||
|
"github.com/pkg/errors"
|
||
|
)
|
||
|
|
||
|
// ErrNotImplemented is an error returned when an operation is Not Implemented.
|
||
|
var ErrNotImplemented = errors.Errorf("not implemented")
|
||
|
|
||
|
// NoopDB implements the DB interface with Noops
|
||
|
type NoopDB int
|
||
|
|
||
|
// Init noop
|
||
|
func (n *NoopDB) Init(c *Config) (AuthDB, error) {
|
||
|
return n, nil
|
||
|
}
|
||
|
|
||
|
// IsRevoked noop
|
||
|
func (n *NoopDB) IsRevoked(sn string) (bool, error) {
|
||
|
return false, nil
|
||
|
}
|
||
|
|
||
|
// Revoke returns a "NotImplemented" error.
|
||
|
func (n *NoopDB) Revoke(rci *RevokedCertificateInfo) error {
|
||
|
return ErrNotImplemented
|
||
|
}
|
||
|
|
||
|
// StoreCertificate returns a "NotImplemented" error.
|
||
|
func (n *NoopDB) StoreCertificate(crt *x509.Certificate) error {
|
||
|
return ErrNotImplemented
|
||
|
}
|
||
|
|
||
|
// Shutdown returns nil
|
||
|
func (n *NoopDB) Shutdown() error {
|
||
|
return nil
|
||
|
}
|