Work on failed outbound requests and move type migrators
- DB type migrators are now in separate file, in preparation for full custom sql migration statements - Start work on handling failed outbound requests stored in the db
This commit is contained in:
parent
81a01fbf8b
commit
7ac4c628b8
13 changed files with 372 additions and 145 deletions
|
@ -39,6 +39,7 @@ func newServerMetadata(db *gorm.DB, opts ...gen.DOOption) serverMetadata {
|
|||
_serverMetadata.LECSR = field.NewBytes(tableName, "lecsr")
|
||||
_serverMetadata.LELastUpdate = field.NewField(tableName, "le_last_update")
|
||||
_serverMetadata.LEUserPrivKey = field.NewBytes(tableName, "le_user_priv_key")
|
||||
_serverMetadata.LastMigrationVersion = field.NewUint64(tableName, "last_migration_version")
|
||||
|
||||
_serverMetadata.fillFieldMap()
|
||||
|
||||
|
@ -48,19 +49,20 @@ func newServerMetadata(db *gorm.DB, opts ...gen.DOOption) serverMetadata {
|
|||
type serverMetadata struct {
|
||||
serverMetadataDo
|
||||
|
||||
ALL field.Asterisk
|
||||
Id field.Uint64
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
LEDomain field.String
|
||||
LECertUrl field.String
|
||||
LECertStableUrl field.String
|
||||
LEPrivateKey field.Bytes
|
||||
LECertificate field.Bytes
|
||||
LEIssuerCertificate field.Bytes
|
||||
LECSR field.Bytes
|
||||
LELastUpdate field.Field
|
||||
LEUserPrivKey field.Bytes
|
||||
ALL field.Asterisk
|
||||
Id field.Uint64
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
LEDomain field.String
|
||||
LECertUrl field.String
|
||||
LECertStableUrl field.String
|
||||
LEPrivateKey field.Bytes
|
||||
LECertificate field.Bytes
|
||||
LEIssuerCertificate field.Bytes
|
||||
LECSR field.Bytes
|
||||
LELastUpdate field.Field
|
||||
LEUserPrivKey field.Bytes
|
||||
LastMigrationVersion field.Uint64
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
@ -89,6 +91,7 @@ func (s *serverMetadata) updateTableName(table string) *serverMetadata {
|
|||
s.LECSR = field.NewBytes(table, "lecsr")
|
||||
s.LELastUpdate = field.NewField(table, "le_last_update")
|
||||
s.LEUserPrivKey = field.NewBytes(table, "le_user_priv_key")
|
||||
s.LastMigrationVersion = field.NewUint64(table, "last_migration_version")
|
||||
|
||||
s.fillFieldMap()
|
||||
|
||||
|
@ -105,7 +108,7 @@ func (s *serverMetadata) GetFieldByName(fieldName string) (field.OrderExpr, bool
|
|||
}
|
||||
|
||||
func (s *serverMetadata) fillFieldMap() {
|
||||
s.fieldMap = make(map[string]field.Expr, 12)
|
||||
s.fieldMap = make(map[string]field.Expr, 13)
|
||||
s.fieldMap["id"] = s.Id
|
||||
s.fieldMap["created_at"] = s.CreatedAt
|
||||
s.fieldMap["updated_at"] = s.UpdatedAt
|
||||
|
@ -118,6 +121,7 @@ func (s *serverMetadata) fillFieldMap() {
|
|||
s.fieldMap["lecsr"] = s.LECSR
|
||||
s.fieldMap["le_last_update"] = s.LELastUpdate
|
||||
s.fieldMap["le_user_priv_key"] = s.LEUserPrivKey
|
||||
s.fieldMap["last_migration_version"] = s.LastMigrationVersion
|
||||
}
|
||||
|
||||
func (s serverMetadata) clone(db *gorm.DB) serverMetadata {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue