Skip to content

Commit

Permalink
feat: pubsub follows retry policies (#3729)
Browse files Browse the repository at this point in the history
closes #3491
  • Loading branch information
matt2e authored and jvmakine committed Dec 13, 2024
1 parent 7eeef45 commit fba3986
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 35 deletions.
12 changes: 3 additions & 9 deletions internal/schema/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,9 @@ func (d *Data) Monomorphise(ref *Ref) (*Data, error) {
}
n.Type = t

case *Any, *Bool, *Bytes, *Data, *Ref, *Database, Decl, *Float,
IngressPathComponent, *IngressPathLiteral, *IngressPathParameter,
*Int, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataRetry,
*MetadataIngress, *MetadataCronJob, *MetadataAlias, *MetadataSecrets, *Module,
*Schema, *String, *Time, Type, *TypeParameter, *Unit, *Verb, *Enum,
*EnumVariant, Value, *IntValue, *StringValue, *TypeValue, Symbol,
Named, *TypeAlias, *Topic, *MetadataSubscriber, *MetadataTypeMap,
*MetadataEncoding, *MetadataPublisher, *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime,
DatabaseConnector, *AWSIAMAuthDatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned:
case Type, Metadata, Value, IngressPathComponent, DatabaseConnector,
*Module, *Schema, *TypeParameter, *Verb, *Enum, *TypeAlias, *Topic, *Database,
*DatabaseRuntimeConnections, *Data, *EnumVariant, *DatabaseRuntime:
}
return next()
})
Expand Down
10 changes: 3 additions & 7 deletions internal/schema/jsonschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,9 @@ func nodeToJSSchema(node Node, refs map[RefKey]*Ref) *jsonschema.Schema {
case *TypeAlias:
return nodeToJSSchema(node.Type, refs)

case Decl, *Field, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataIngress,
*MetadataAlias, *MetadataSecrets, IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, *Module,
*Schema, Type, *Database, *Verb, *EnumVariant, *MetadataCronJob, Value,
*StringValue, *IntValue, *TypeValue, *Config, *Secret, Symbol, Named,
*MetadataRetry, *Topic, *MetadataSubscriber, *MetadataTypeMap,
*MetadataEncoding, *MetadataPublisher, *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime,
*AWSIAMAuthDatabaseConnector, DatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned:
case Metadata, IngressPathComponent, DatabaseConnector, Type, Value,
*Module, *Field, *Schema, *Database, *Verb, *EnumVariant,
*Config, *Secret, *Topic, *DatabaseRuntime, *DatabaseRuntimeConnections:
panic(fmt.Sprintf("unsupported node type %T", node))

default:
Expand Down
28 changes: 9 additions & 19 deletions internal/schema/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,11 @@ func ValidateModuleInSchema(schema *Schema, m optional.Option[*Module]) (*Schema
}
return next()

case *Array, *Bool, *Bytes, *Data, Decl, *Field, *Float,
IngressPathComponent, *IngressPathLiteral, *IngressPathParameter,
*Int, *Map, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataCronJob,
*MetadataIngress, *MetadataAlias, *MetadataSecrets, *Module, *Optional, *Schema, *TypeAlias,
*String, *Time, Type, *Unit, *Any, *TypeParameter, *EnumVariant, *MetadataRetry,
Value, *IntValue, *StringValue, *TypeValue, *Config, *Secret, Symbol, Named,
*MetadataSubscriber, *Topic, *MetadataTypeMap, *MetadataEncoding, *MetadataPublisher,
*MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, DatabaseConnector,
*AWSIAMAuthDatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned:
case
IngressPathComponent, Metadata, Value, Type, DatabaseConnector,
*Module, *Optional, *Schema, *TypeAlias, *String, *Time, *Unit, *Any, *TypeParameter,
*EnumVariant, *Config, *Secret, *Topic, *DatabaseRuntime, *DatabaseRuntimeConnections,
*Data, *Field:
}
return next()
})
Expand Down Expand Up @@ -360,16 +356,10 @@ func ValidateModule(module *Module) error {
n.Catch.Module = module.Name
}

case *Array, *Bool, *Database, *Float, *Int,
*Time, *Map, *Module, *Schema, *String, *Bytes,
*MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataIngress, *MetadataCronJob, *MetadataAlias,
*MetadataSecrets, IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, *Optional,
*Unit, *Any, *TypeParameter, *Enum, *EnumVariant, *IntValue, *StringValue, *TypeValue,
*Config, *Secret, *MetadataSubscriber, *MetadataTypeMap, *MetadataEncoding, *MetadataPublisher,
*MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, *AWSIAMAuthDatabaseConnector,
*MetadataArtefact, DatabaseConnector, *DatabaseRuntimeConnections, Provisioned:

case Named, Symbol, Type, Metadata, Value, Decl: // Union types.
case Type, Metadata, Value, IngressPathComponent, DatabaseConnector,
*Module, *Schema, *Optional, *TypeParameter, *EnumVariant,
*Config, *Secret, *DatabaseRuntime, *DatabaseRuntimeConnections,
*Database, *Enum:
}
return next()
})
Expand Down

0 comments on commit fba3986

Please sign in to comment.