moving a function and struct over to a common library, starting on lockfile for server

This commit is contained in:
2020-06-07 23:26:13 -04:00
parent 6d738b138d
commit b2238657c8
12 changed files with 123 additions and 119 deletions

View File

@@ -1,5 +1,7 @@
package config
import "github.com/deranjer/gvc/common"
// GvcServerConfig will hold the base server settings
type GvcServerConfig struct {
Version string `toml:"version"` // The server version
@@ -12,14 +14,14 @@ type GvcServerConfig struct {
// RepoConfig will be the struct that holds the config for a single repo
type RepoConfig struct {
KnownClients []Clients `toml:"client"` //The remote servers for the repo
RootPath string `toml:"rootpath"` // The absolute path to the root of this particular repo
RepoName string `toml:"reponame"`
DefaultBranch string `toml:"defaultbranch"`
LocalBranches []string `toml:"localbranches"` // LocalBranches constains a string list of branches on the server. Names must be unique. \\TODO: someday add folders like git for branches
Locked FileTypes `toml:"locked"`
DefaultIgnores FileTypes `toml:"defaultignore"` //These are the recommended ignores that clients can pull
NoCompress FileTypes `toml:"nocompress"` //For binary compression some files should be ignored because the performance hit isn't worth the size savings
KnownClients []Clients `toml:"client"` //The remote servers for the repo
RootPath string `toml:"rootpath"` // The absolute path to the root of this particular repo
RepoName string `toml:"reponame"`
DefaultBranch string `toml:"defaultbranch"`
LocalBranches []string `toml:"localbranches"` // LocalBranches constains a string list of branches on the server. Names must be unique. \\TODO: someday add folders like git for branches
Locked common.FileTypes `toml:"locked"`
DefaultIgnores common.FileTypes `toml:"defaultignore"` //These are the recommended ignores that clients can pull
NoCompress common.FileTypes `toml:"nocompress"` //For binary compression some files should be ignored because the performance hit isn't worth the size savings
}
//Clients will be a slice of clients that have authenticated to the server
@@ -28,10 +30,3 @@ type Clients struct {
Key string `toml:"key"` //TODO will change this once we figure out authentication
LastCommit string `toml:"lastcommit"` //Last commit that this client pushed to the server? not sure if useful
}
//FileTypes is for ignoring files to add or ignoring compress, or for locked files, all use the same type of struct (files, folders and exts)
type FileTypes struct {
Files []string `toml:"files"`
Exts []string `toml:"exts"`
Folders []string `toml:"folders"`
}