Documentation
¶
Index ¶
- func Capitalize(s string) string
- func GenerateAllGoFiles(config Config, outputDir string, packageName string)
- func GenerateAllTSFiles(config Config, outputDir string)
- func GetGoItemType(field Field, config Config, withPackagePrefix bool) string
- func GoEnumConst(s string) string
- func HasComplexField(fields []Field, config Config) bool
- func HasGeopointField(fields []Field) bool
- func HasStringIDField(fields []Field) bool
- func HasTimeField(fields []Field) bool
- func IsArray(field Field) bool
- func PascalCase(s string) string
- func ToPascalCase(s string) string
- type Collection
- type Config
- type Enum
- type Field
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
func GenerateAllGoFiles ¶
func GenerateAllTSFiles ¶
func GoEnumConst ¶
GoEnumConst converts an enum value string into a valid, exported Go constant name. - Keeps the original value string intact for assignment - Strips/replaces special characters (e.g., '-') from the identifier name - Converts words to PascalCase - Ensures the identifier does not start with a digit by prefixing with 'X'
func HasComplexField ¶
func HasGeopointField ¶
func HasStringIDField ¶
func HasTimeField ¶
func IsArray ¶
getGoType returns the proper Go type for a field, handling enums and schema references
func PascalCase ¶
func ToPascalCase ¶
ToPascalCase converts strings to PascalCase for TypeScript naming conventions Examples: "in_progress" -> "InProgress", "iOS" -> "Ios", "hello-world" -> "HelloWorld"
Types ¶
type Collection ¶
type Collection struct {
Name string `yaml:"name"` // Collection name
FirebasePath string `yaml:"firebasePath"` // Path in Firebase where this collection lives
Params []string `yaml:"params,omitempty"` // URL parameters for the path (optional)
Schema string `yaml:"schema"` // Reference to which schema this collection uses
}
type Config ¶
type Config struct {
Enums []Enum `yaml:"enums"` // All enum definitions
Schemas []Schema `yaml:"schemas"` // All schema definitions
Collections []Collection `yaml:"collections"` // All collection definitions
}
type Field ¶
type Field struct {
Name string `yaml:"name"` // Field name (e.g., "title", "status")
Type string `yaml:"type"` // Field type (e.g., "string", "number", "boolean")
Required bool `yaml:"required"` // Whether this field is required
Enum string `yaml:"enum,omitempty"` // Reference to an enum type (optional)
Items interface{} `yaml:"items,omitempty"` // For array types, what type of items (schema name or basic type)
}
Click to show internal directories.
Click to hide internal directories.