diff --git a/README.md b/README.md index e830149..224fade 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ -# Sharkk Config File +# Fin -SCF, pronounced scuff! +Fin is a very light, very intuitive config file format! Few symbols, few rules, quite flexible. Has support for comments, arrays, maps, and type guarantees. -A very light, very intuitive config file format! Few symbols, few rules, quite flexible. Has support for comments, arrays, maps, and type guarantees. - -Mercilessly benchmarked, fully tested. SCF competes toe-to-toe with Go's native JSON library, and handily outperforms the reference TOML and YAML implementations. +Mercilessly benchmarked, fully tested. Fin competes toe-to-toe with Go's native JSON library, and handily outperforms the reference TOML and YAML implementations. ## Format -SCF has very very simple syntax. +Fin has very very simple syntax. ``` -- Lua style comments! @@ -40,7 +38,7 @@ database { ## Installation ```bash -go get git.sharkk.net/Go/Config +go get git.sharkk.net/Sharkk/Fin ``` ## Usage @@ -53,8 +51,8 @@ package main import ( "fmt" "os" - - config "git.sharkk.net/Go/Config" + + "git.sharkk.net/Sharkk/Fin" ) func main() { @@ -63,18 +61,18 @@ func main() { panic(err) } defer file.Close() - + // Pass a string to be loaded by the parser! - cfg, err := config.Load(file) + cfg, err := fin.Load(file) if err != nil { panic(err) } - + // Access values with type conversion. host, err := cfg.GetString("database.host") port, err := cfg.GetInt("database.port") debug, err := cfg.GetBool("debug") - + // Use default values for missing keys timeout := cfg.GetOr("timeout", 30).(int) @@ -119,24 +117,24 @@ This parser provides competitive performance compared to popular formats like JS | Benchmark | Operations | Time (ns/op) | Memory (B/op) | Allocations (allocs/op) | |-----------|----------:|-------------:|--------------:|------------------------:| | **Small Config Files** | -| Config | 1,000,000 | 1,052 | 1,743 | 15 | +| Fin | 1,000,000 | 1,052 | 1,743 | 15 | | JSON | 1,000,000 | 1,112 | 1,384 | 23 | | YAML | 215,121 | 5,600 | 8,888 | 82 | | TOML | 286,334 | 4,483 | 4,520 | 67 | | **Medium Config Files** | -| Config | 211,863 | 5,696 | 4,056 | 74 | +| Fin | 211,863 | 5,696 | 4,056 | 74 | | JSON | 261,925 | 4,602 | 5,344 | 89 | | YAML | 50,010 | 23,965 | 21,577 | 347 | | TOML | 68,420 | 17,639 | 16,348 | 208 | | **Large Config Files** | -| Config | 55,338 | 21,556 | 12,208 | 207 | +| Fin | 55,338 | 21,556 | 12,208 | 207 | | JSON | 70,219 | 17,202 | 18,140 | 297 | | YAML | 12,536 | 95,945 | 65,568 | 1,208 | | TOML | 14,732 | 74,198 | 66,050 | 669 | *Benchmarked on AMD Ryzen 9 7950X 16-Core Processor* -## Why Choose SCF? +## Why Choose Fin? - **Readability**: Simple syntax that's easy for humans to read and write - **Flexibility**: Supports various data types and nested structures @@ -146,4 +144,4 @@ This parser provides competitive performance compared to popular formats like JS ## License -MIT \ No newline at end of file +MIT diff --git a/bench/get_test.go b/bench/get_test.go index 061ea73..4b8dc7e 100644 --- a/bench/get_test.go +++ b/bench/get_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - config "git.sharkk.net/Go/SCF" + config "git.sharkk.net/Sharkk/Fin" "github.com/BurntSushi/toml" "gopkg.in/yaml.v3" ) diff --git a/bench/parse_test.go b/bench/parse_test.go index 928290f..4c4971a 100644 --- a/bench/parse_test.go +++ b/bench/parse_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - config "git.sharkk.net/Go/SCF" + config "git.sharkk.net/Sharkk/Fin" "github.com/BurntSushi/toml" "gopkg.in/yaml.v3" ) diff --git a/config.go b/config.go index 0ece9aa..68ee934 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package scf +package fin import ( "fmt" diff --git a/go.mod b/go.mod index ee54bd0..9198213 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.sharkk.net/Go/SCF +module git.sharkk.net/Sharkk/Fin go 1.24.1 diff --git a/pool.go b/pool.go index 74b77f0..a39e659 100644 --- a/pool.go +++ b/pool.go @@ -1,4 +1,4 @@ -package scf +package fin import ( "sync" diff --git a/scanner.go b/scanner.go index a542591..e6f6e53 100644 --- a/scanner.go +++ b/scanner.go @@ -1,4 +1,4 @@ -package scf +package fin import ( "bufio" diff --git a/tests/config_test.go b/tests/config_test.go index f0181e5..948e087 100644 --- a/tests/config_test.go +++ b/tests/config_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - config "git.sharkk.net/Go/SCF" + config "git.sharkk.net/Sharkk/Fin" ) func TestBasicKeyValuePairs(t *testing.T) { @@ -84,12 +84,12 @@ func TestComments(t *testing.T) { input := ` -- This is a line comment key1 "value1" - - --[[ This is a + + --[[ This is a block comment spanning multiple lines ]] key2 "value2" - + settings { -- Comment inside a map timeout 30 @@ -134,7 +134,7 @@ func TestArrays(t *testing.T) { "banana" "cherry" } - + -- Mixed types array mixed { "string" diff --git a/token.go b/token.go index bbe5cd6..34de74e 100644 --- a/token.go +++ b/token.go @@ -1,4 +1,4 @@ -package scf +package fin // TokenType represents the type of token type TokenType int