Regex implementation (yet to be implemented)
This commit is contained in:
parent
902f6513ff
commit
9a7834c330
5 changed files with 72 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
package conf
|
||||
|
||||
/* This file contains the Config object and its methods, which handle reading
|
||||
from a config file and matching requests to the whitelist. */
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
|
@ -7,11 +10,14 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// import "fmt"
|
||||
|
||||
/* Object to handle what is in a JSON config */
|
||||
type Config struct {
|
||||
configData map[string][]string;
|
||||
}
|
||||
|
||||
/* Opens and reads a file at the path */
|
||||
func NewConfig(filePath string) (newConfig *Config, err error) {
|
||||
// Open file
|
||||
file, err := os.Open(filePath)
|
||||
|
@ -34,4 +40,5 @@ func NewConfig(filePath string) (newConfig *Config, err error) {
|
|||
return &Config{configData: newConfigData}, nil;
|
||||
}
|
||||
|
||||
/* Gets a reference copy to the config data */
|
||||
func (config Config) GetConfigData() map[string][]string {return config.configData;}
|
Loading…
Add table
Add a link
Reference in a new issue