switching server over to Echo, setting up server struct
This commit is contained in:
		
							
								
								
									
										30
									
								
								server/serverconfig/structures.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								server/serverconfig/structures.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
package config
 | 
			
		||||
 | 
			
		||||
type GvcServerConfig struct {
 | 
			
		||||
	Version string       `toml:"version"` // The server version
 | 
			
		||||
	Repos   []RepoConfig `toml:"repos"`   // A struct of all the repos and their settings for the serve
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//GvcServerConfig will be the struct that holds the entire server settings
 | 
			
		||||
type RepoConfig struct {
 | 
			
		||||
	KnownClients   []Clients `toml:"clients"` //The remote servers for the repo
 | 
			
		||||
	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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//Clients will be a slice of clients that have authenticated to the server
 | 
			
		||||
type Clients struct {
 | 
			
		||||
	Name       string `toml:"name"`
 | 
			
		||||
	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"`
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user