-
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.
feat: move from sqlite to json for data storage
- Loading branch information
Showing
17 changed files
with
222 additions
and
427 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 |
---|---|---|
@@ -1,29 +1,13 @@ | ||
package cli | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"github.com/DeeStarks/conoid/config" | ||
"github.com/DeeStarks/conoid/utils" | ||
_ "github.com/mattn/go-sqlite3" | ||
type ( | ||
ICLICommands interface { | ||
Services() *ServiceCommand | ||
} | ||
CLICommands struct{} | ||
) | ||
|
||
type ICLICommands interface { | ||
Services() *ServiceCommand | ||
} | ||
|
||
type CLICommands struct { | ||
defaultDB *sql.DB | ||
} | ||
|
||
// Accept and process CLI commands. | ||
func NewCLICommands() ICLICommands { | ||
// Connect to the default db | ||
defaultDB, err := sql.Open("sqlite3", config.DEFAULT_DB) | ||
if err != nil { | ||
utils.Log("Could not connect DB:", err) | ||
} | ||
return &CLICommands{ | ||
defaultDB: defaultDB, | ||
} | ||
return &CLICommands{} | ||
} |
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.