mirror of
https://github.com/nicksherron/bashhub-server.git
synced 2024-09-20 12:05:56 +08:00
commenting exported vars/funcs and blank imports
This commit is contained in:
parent
f13c5beb73
commit
7b16271dbe
|
@ -51,7 +51,7 @@ Flags:
|
|||
Use " [command] --help" for more information about a command.
|
||||
|
||||
```
|
||||
|
||||
### Running
|
||||
Just run the server
|
||||
|
||||
```shell script
|
||||
|
@ -65,4 +65,9 @@ docker run -d -p 8080:8080 --name bashhub-server nicksherron/bashhub-server
|
|||
```
|
||||
Then add ```export BH_HOST=localhost:8080``` (or whatever you set your bashhub-server address to) to your .zshrc or .bashrc
|
||||
|
||||
Thats it!
|
||||
Thats it! Restart your shell with `$SHELL` then re-configure bashhub-client to use your new
|
||||
server by re-running ```bashhub setup``` .
|
||||
|
||||
### Setting DB
|
||||
|
||||
### Using Regex
|
||||
|
|
|
@ -39,7 +39,7 @@ var rootCmd = &cobra.Command{
|
|||
internal.Run()
|
||||
},
|
||||
}
|
||||
|
||||
// Execute runs root command
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
|
|
|
@ -27,8 +27,11 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
// db driver are called by gorm
|
||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
// db driver are called by gorm
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
// db driver are called by database/sql
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/mattn/go-sqlite3"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
@ -47,6 +50,7 @@ func dbInit() {
|
|||
var err error
|
||||
if strings.HasPrefix(DbPath, "postgres://") {
|
||||
// postgres
|
||||
|
||||
db, err = sql.Open("postgres", DbPath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
@ -81,7 +81,9 @@ type System struct {
|
|||
}
|
||||
|
||||
var (
|
||||
// Addr is the listen and server address for our server (gin)
|
||||
Addr string
|
||||
// LogFile is the log file location for http logging. Default is stderr.
|
||||
LogFile string
|
||||
)
|
||||
|
||||
|
@ -107,7 +109,7 @@ func loggerWithFormatterWriter(f gin.LogFormatter) gin.HandlerFunc {
|
|||
Output: getLog(),
|
||||
})
|
||||
}
|
||||
|
||||
// Run starts server
|
||||
func Run() {
|
||||
// Initialize backend
|
||||
dbInit()
|
||||
|
|
Loading…
Reference in a new issue