feat: migrate backend from rust to go
This commit replaces the Axum/Rust backend with a Gin/Go implementation. The original Rust code has been archived in the 'rust' branch.
This commit is contained in:
19
internal/utils/utils.go
Normal file
19
internal/utils/utils.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ParseDataURL(dataURL string) (string, string, error) {
|
||||
if !strings.HasPrefix(dataURL, "data:") {
|
||||
return "", "", fmt.Errorf("not a data URL")
|
||||
}
|
||||
|
||||
parts := strings.Split(dataURL[5:], ";base64,")
|
||||
if len(parts) != 2 {
|
||||
return "", "", fmt.Errorf("invalid data URL format")
|
||||
}
|
||||
|
||||
return parts[0], parts[1], nil
|
||||
}
|
||||
Reference in New Issue
Block a user