Regex implementation (yet to be implemented)

This commit is contained in:
Ben 2025-07-26 23:57:34 -07:00
parent 902f6513ff
commit 9a7834c330
Signed by: webmaster
GPG key ID: A5FCBAF34E6E8B50
5 changed files with 72 additions and 3 deletions

View file

@ -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;}