Full Go backend + Vue 3 frontend, OpenAI-compatible API, multi-provider account pools, billing/admin, Docker one-command deploy with auto HTTPS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
348 B
Go
21 lines
348 B
Go
package service
|
|
|
|
import nanoid "github.com/matoous/go-nanoid/v2"
|
|
|
|
const UpperAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
|
|
func randomUpper(n int) string {
|
|
v, err := nanoid.Generate(UpperAlphabet, n)
|
|
if err != nil {
|
|
if n <= 0 {
|
|
return ""
|
|
}
|
|
out := make([]byte, n)
|
|
for i := range out {
|
|
out[i] = 'A'
|
|
}
|
|
return string(out)
|
|
}
|
|
return v
|
|
}
|