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,17 +1,19 @@
package config
import "github.com/deranjer/gvc/common"
//Gvcconfig will be the struct that holds the entire client settings
type Gvcconfig struct {
Version string `toml:"version"`
RootPath string `toml:"rootpath"`
RepoName string `toml:"reponame"`
Remotes []Remote `toml:"remote"` //The remote servers for the repo
CurrentBranch string `toml:"currentbranch"`
LocalBranches []string `toml:"localbranches"` // LocalBranches constains a string list of branches on the local client. Names must be unique. \\TODO: someday add folders like git for branches
RemoteBranches []string `toml:"remotebranches"` // RemoteBranches 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"`
Ignores FileTypes `toml:"ignore"` //These files will be ignored for all add functions
NoCompress FileTypes `toml:"nocompress"` //For binary compression some files should be ignored because the performance hit isn't worth the size savings
Version string `toml:"version"`
RootPath string `toml:"rootpath"`
RepoName string `toml:"reponame"`
Remotes []Remote `toml:"remote"` //The remote servers for the repo
CurrentBranch string `toml:"currentbranch"`
LocalBranches []string `toml:"localbranches"` // LocalBranches constains a string list of branches on the local client. Names must be unique. \\TODO: someday add folders like git for branches
RemoteBranches []string `toml:"remotebranches"` // RemoteBranches 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"`
Ignores common.FileTypes `toml:"ignore"` //These files will be ignored for all add functions
NoCompress common.FileTypes `toml:"nocompress"` //For binary compression some files should be ignored because the performance hit isn't worth the size savings
}
//Remote will be a slice of remote server information
@@ -21,10 +23,3 @@ type Remote struct {
Port int `toml:"port"`
Default bool `toml:"default"` //Is this repo the default repo?
}
//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"`
}