parser

package
v0.8.1-0...-b330c16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	PkgPath string
	Name    string
	Plural  string
	DBName  string
	Fields  []Field
	Indexes []Index // Compound indexes defined via comments
}

func ParseDataGo

func ParseDataGo(path string) ([]Entity, error)

type Field

type Field struct {
	Name     string
	Type     string
	JSONTag  string
	BSONTag  string
	Validate string
	Index    string // Index definition: "1", "-1", "text", "unique", etc.
}

type Index

type Index struct {
	Fields []IndexField // Fields in the index
	Unique bool         // Whether the index is unique
	Sparse bool         // Whether the index is sparse
	Name   string       // Custom index name (optional)
}

type IndexField

type IndexField struct {
	Name      string // Field name
	Direction int    // 1 for ascending, -1 for descending
	Type      string // "text", "2dsphere", etc. (optional)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL