-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following: commit 8a21e47 Author: Rafael Espinoza <[email protected]> Date: Sat Jan 15 17:51:04 2022 -0800 refactor: Simplify exported API There are too many exported identifiers in package godfish. A developer interested in making a new driver implementation really just needs to know about the Driver interface and not much else. Split up the code so that the only exposed functionality may build: - a Driver implementation (pkg godfish/drivers/...) - a standalone binary (pkg godfish/internal/cmd) The material that was in pkg godfish is important to get that working, but is probably not necessary for outside consumers. Most of these changes involve moving material from pkg godfish to pkg internal, adjusting callers, and ensuring that pkg godfish's exported API doesn't reference pkg internal. Other notable changes are: - Change UpdateSchemaMigrations signature. Putting the Direction type in a method signature complicates things IMO; in practice, it means up or down, so a boolean makes more sense here. The Direction type is useful for disambiguating labels for the direction in a migration filename, but that's not a concern for a Driver implementation. - Remove func CreateSchemaMigrations because it's not used anywhere and the functionality is already in a Driver method. - Move buildtime versioning info variables to pkg cmd because the Version type is now in pkg internal. - Move validation for direction label to ensure it's always validated, not just in the subcommand. - Move pkg info stuff into pkg internal, this simplifies dependencies. commit 88b0f7d Author: Rafael Espinoza <[email protected]> Date: Fri Jan 7 19:53:33 2022 -0800 refactor: Clean up Migration constructor It's a little weird have syscall side effects in a constructor func, so remove the directory check (use of the Dirpath field) from that. Also clean up code some more. Static interface checks are deadweight; it's better to define a field with an interface type and assign a concrete type to that field to check if a type implements an interface. Clean up, fix tests
- Loading branch information
1 parent
a4ac74b
commit 8d6ada0
Showing
33 changed files
with
606 additions
and
574 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
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
Oops, something went wrong.