Documentation ¶
Overview ¶
Package configurationFile represents Encodable/Decodable Golang structures from/to TOML structures.
* *The global structure is ConfigurationFile, which is the simple way to store accurtely your local informations. *
Index ¶
- func DecodeBytesArray(c *ConfigurationFile, data []byte) error
- func DecodeString(c *ConfigurationFile, data string) error
- func GetConfigurationFileContent(filePointer *os.File, bytesArray *[]byte)
- type ConfigurationFile
- type GitRepository
- type Group
- type GroupPath
- type LocalInformations
- type VisibleRepositories
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBytesArray ¶
func DecodeBytesArray(c *ConfigurationFile, data []byte) error
DecodeBytesArray is a function to decode an entire string (which is the content of a given TOML file) to a ConfigurationFile structure
func DecodeString ¶
func DecodeString(c *ConfigurationFile, data string) error
DecodeString is a function to decode an entire string (which is the content of a given TOML file) to a ConfigurationFile structure
func GetConfigurationFileContent ¶
GetConfigurationFileContent get the content of the local configuration file.
*If no configuration file has been found, create a default one and set the bytes array.
Types ¶
type ConfigurationFile ¶
type ConfigurationFile struct { Author string Local LocalInformations `toml:"local"` Repositories map[string]GitRepository `toml:"repositories"` VisibleRepositories VisibleRepositories `toml:"-"` Groups map[string]Group `toml:"group"` // contains filtered or unexported fields }
ConfigurationFile represents the TOML structure of the Goyave configuration file
* *Properties: * Author: * The name of the user * Local: * Local informations * Repositories: * Local git repositories * VisibleRepositories: * A list of local ** visible ** git repositories (** used localy **) * Groups: * A list of groups * locker: * Mutex to perform concurrent RW on map data structures
func Default ¶
func Default(author string, hostname string) *ConfigurationFile
Default is a constructor for ConfigurationFile
* *Parameters: * author: * The name of the user * hostname: * The machine hostname
func (*ConfigurationFile) AddRepository ¶
func (c *ConfigurationFile) AddRepository(path, target string) error
AddRepository append the given repository to the list of local repositories, if it does not exists
func (*ConfigurationFile) Encode ¶
func (c *ConfigurationFile) Encode(buffer *bytes.Buffer) error
Encode is a function to encode a ConfigurationFile structure to a byffer of bytes
func (*ConfigurationFile) GetPath ¶
func (c *ConfigurationFile) GetPath(repository string) (string, bool)
GetPath returns the local path file, for a given repository
func (*ConfigurationFile) Process ¶
func (c *ConfigurationFile) Process()
Process initializes useful fields in the data structure
type GitRepository ¶
type GitRepository struct { Name string `toml:"name"` Paths map[string]GroupPath `toml:"paths"` URL string `toml:"url"` }
GitRepository represents the structure of a local git repository
* *Properties: * Name: * The custom name of the repository * Paths: * Path per group name * URL: * The remote URL of the repository (from origin)
type GroupPath ¶
GroupPath represents the structure of a local path, using a given group
* *Properties: * Name: * The name of the local git repository * Path: * A string that points to the local git repository
type LocalInformations ¶
LocalInformations represents your local configuration of Goyave
* *Properties: * DefaultEntry: * The default entry to store a git repository (hidden or visible) * Group: * The current group name.
type VisibleRepositories ¶
VisibleRepositories is a map structure to store, for each repository name (and the hostname), the associated path