generated from dogmatiq/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
80 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package sqltest | ||
|
||
var ( | ||
// DriversByProduct maps a Product to the Driver implementations that it is | ||
// compatible with. | ||
DriversByProduct = map[Product][]Driver{} | ||
|
||
// ProductsByDriver maps a Driver to the Product implementations that it is | ||
// compatible with. | ||
ProductsByDriver = map[Driver][]Product{} | ||
|
||
// CompatiblePairs contains all compatible driver/product pairs. | ||
CompatiblePairs []Pair | ||
) | ||
|
||
// Pair is a struct containing a driver and product that are compatible with | ||
// each other. | ||
type Pair struct { | ||
Driver Driver | ||
Product Product | ||
} | ||
|
||
func init() { | ||
for _, d := range Drivers { | ||
for _, p := range Products { | ||
if p.IsCompatibleWith(d) { | ||
DriversByProduct[p] = append(DriversByProduct[p], d) | ||
ProductsByDriver[d] = append(ProductsByDriver[d], p) | ||
CompatiblePairs = append(CompatiblePairs, Pair{d, p}) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters