[acmedb] (wip)
This commit is contained in:
parent
31ad7f2e9b
commit
0368957e79
2 changed files with 9 additions and 5 deletions
|
@ -84,9 +84,8 @@ func (db *DB) GetOrder(id string) (*types.Order, error) {
|
||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// newOrder returns a new Order type.
|
func (db *DB) CreateOrder(ctx context.Context, o *types.Order) error {
|
||||||
func newOrder(db nosql.DB, ops OrderOptions) (*order, error) {
|
o.ID, err := randID()
|
||||||
id, err := randID()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -112,7 +111,7 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) {
|
||||||
naf = nbf.Add(ops.defaultDuration)
|
naf = nbf.Add(ops.defaultDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
o := &order{
|
dbo := &dbOrder{
|
||||||
ID: id,
|
ID: id,
|
||||||
AccountID: ops.AccountID,
|
AccountID: ops.AccountID,
|
||||||
Created: now,
|
Created: now,
|
||||||
|
@ -123,7 +122,7 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) {
|
||||||
NotAfter: naf,
|
NotAfter: naf,
|
||||||
Authorizations: authzs,
|
Authorizations: authzs,
|
||||||
}
|
}
|
||||||
if err := o.save(db, nil); err != nil {
|
if err := db.saveDBOrder(dbo, nil); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +134,10 @@ func newOrder(db nosql.DB, ops OrderOptions) (*order, error) {
|
||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// newOrder returns a new Order type.
|
||||||
|
func newOrder(db nosql.DB, ops OrderOptions) (*order, error) {
|
||||||
|
}
|
||||||
|
|
||||||
type orderIDsByAccount struct{}
|
type orderIDsByAccount struct{}
|
||||||
|
|
||||||
// addOrderID adds an order ID to a users index of in progress order IDs.
|
// addOrderID adds an order ID to a users index of in progress order IDs.
|
||||||
|
|
|
@ -18,6 +18,7 @@ type Order struct {
|
||||||
Finalize string `json:"finalize"`
|
Finalize string `json:"finalize"`
|
||||||
Certificate string `json:"certificate,omitempty"`
|
Certificate string `json:"certificate,omitempty"`
|
||||||
ID string `json:"-"`
|
ID string `json:"-"`
|
||||||
|
ProvisionerID string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToLog enables response logging.
|
// ToLog enables response logging.
|
||||||
|
|
Loading…
Reference in a new issue