database: fix build
This commit is contained in:
parent
6fc2e13e54
commit
d6da19c063
|
@ -60,11 +60,11 @@ func (b *BoltDBStorage) GetRoute(ctx context.Context, host string) (Route, error
|
|||
|
||||
switch err {
|
||||
case storm.ErrNotFound:
|
||||
return errors.Wrapf(err, "%v", ErrNoSuchRoute)
|
||||
case storm.AlreadyExists:
|
||||
return errors.Wrapf(err, "%v", ErrRouteAlreadyExists)
|
||||
return Route{}, errors.Wrapf(err, "%v", ErrNoSuchRoute)
|
||||
case storm.ErrAlreadyExists:
|
||||
return Route{}, errors.Wrapf(err, "%v", ErrRouteAlreadyExists)
|
||||
default:
|
||||
return errors.Wrapf(err, "%v", ErrUnknown)
|
||||
return Route{}, errors.Wrapf(err, "%v", ErrUnknown)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package database
|
||||
|
||||
// CryptoLevel indicates what form of cryptography the certificate is stored
|
||||
// with.
|
||||
type CryptoLevel int
|
||||
|
||||
// Crypto levels / strategies defined
|
||||
const (
|
||||
// NOTE: this is defined for debugging / testing usage only
|
||||
CryptoLevelNone CryptoLevel = iota
|
||||
|
||||
// Use the global set of secretbox keys
|
||||
CryptoLevelSecretbox
|
||||
)
|
||||
|
||||
// CachedCert is an individual cached certificate in the database.
|
||||
type CachedCert struct {
|
||||
Key string `gorethink:"id" storm:"id"`
|
||||
CryptoLevel CryptoLevel `gorethink:"cryptoLevel"`
|
||||
// PEM-encoded bytes with the above crypto level as a filter.
|
||||
Body []byte `gorethink:"body"`
|
||||
}
|
|
@ -9,7 +9,7 @@ import (
|
|||
type Storage interface {
|
||||
// routes
|
||||
GetRoute(ctx context.Context, host string) (Route, error)
|
||||
GetAllRoutes(ctx context.Context) ([]Route, error)
|
||||
GetAllRoutes(ctx context.Context, user string) ([]Route, error)
|
||||
PutRoute(ctx context.Context, domain, kind string) (Route, error)
|
||||
DeleteRoute(ctx context.Context, id string) error
|
||||
|
||||
|
|
Loading…
Reference in New Issue