Refactor kafka to pure Go (franz-go), fix DBC stubs, update Dockerfile

This commit is contained in:
Chris Rai
2026-01-31 00:05:47 -05:00
parent fbb820d7b3
commit b5bec57dfa
776 changed files with 18945 additions and 2052 deletions

View File

@@ -0,0 +1,17 @@
package identifiers
import "unicode"
func IsCamelCase(s string) bool {
i := 0
for _, r := range s {
if unicode.IsDigit(r) {
continue
}
if i == 0 && !unicode.IsUpper(r) || !IsAlphaChar(r) && !IsNumChar(r) {
return false
}
i++
}
return true
}

View File

@@ -0,0 +1,18 @@
package identifiers
import (
"testing"
"gotest.tools/v3/assert"
)
func TestIsCamelCase(t *testing.T) {
assert.Assert(t, IsCamelCase("SOC"))
assert.Assert(t, IsCamelCase("Camel"))
assert.Assert(t, IsCamelCase("CamelCase"))
assert.Assert(t, IsCamelCase("111CamelCaseNr"))
assert.Assert(t, !IsCamelCase("camelCase"))
assert.Assert(t, !IsCamelCase("snake_case"))
assert.Assert(t, !IsCamelCase("kebab-case"))
assert.Assert(t, !IsCamelCase("111camelCaseNr"))
}

View File

@@ -0,0 +1,9 @@
package identifiers
func IsAlphaChar(r rune) bool {
return ('A' <= r && r <= 'Z') || ('a' <= r && r <= 'z')
}
func IsNumChar(r rune) bool {
return '0' <= r && r <= '9'
}

View File

@@ -0,0 +1,23 @@
package identifiers
import (
"testing"
"gotest.tools/v3/assert"
)
func TestIsAlphaChar(t *testing.T) {
assert.Assert(t, IsAlphaChar('b'))
assert.Assert(t, IsAlphaChar('C'))
assert.Assert(t, !IsAlphaChar('Ö'))
assert.Assert(t, !IsAlphaChar('_'))
}
func TestIsNumChar(t *testing.T) {
assert.Assert(t, IsNumChar('0'))
assert.Assert(t, IsNumChar('1'))
assert.Assert(t, IsNumChar('2'))
assert.Assert(t, IsNumChar('9'))
assert.Assert(t, !IsNumChar('/'))
assert.Assert(t, !IsNumChar('a'))
}