making changes to common library, starting to integrate database functions

This commit is contained in:
2020-06-11 17:24:35 -04:00
parent 0ecb0b96ce
commit d335549fd5
15 changed files with 317 additions and 145 deletions

View File

@@ -1,16 +1,21 @@
package config
import "github.com/deranjer/gvc/common"
import (
"github.com/asdine/storm"
"github.com/deranjer/gvc/common"
)
// GvcServerConfig will hold the base server settings
type GvcServerConfig struct {
LogFile string `toml:"logfile"` // Where to store the echo logs
Version string `toml:"version"` // The server version
Port int `toml:"port"` // The port that the server will listed on
BindIP string `toml:"ip"` // What IP to bind the server to. If empty will bind to all interfaces
RawPort int `toml:"rawport"` // The optional TCP port that the server will send raw files over
RepoRootPath string `toml:"reporootpath"` // This will be the root path where (by default) all new repos will be stored at
Repos []RepoConfig `toml:"repo"` // A struct of all the repos and their settings for the serve
LogFile string `toml:"logfile"` // Where to store the echo logs
DatabaseLocation string `toml:"databaselocation"` // Location of the database
Database *storm.DB // DB Handle for passing around
Version string `toml:"version"` // The server version
Port int `toml:"port"` // The port that the server will listed on
BindIP string `toml:"ip"` // What IP to bind the server to. If empty will bind to all interfaces
RawPort int `toml:"rawport"` // The optional TCP port that the server will send raw files over
RepoRootPath string `toml:"reporootpath"` // This will be the root path where (by default) all new repos will be stored at
Repos []RepoConfig `toml:"repo"` // A struct of all the repos and their settings for the serve
}
// RepoConfig will be the struct that holds the config for a single repo