Documentation
¶
Overview ¶
Package gogen implements the Go client code generator for melange.
This generator produces type-safe Go code from authorization schemas, including object type constants, relation constants, and constructor functions.
Generated code uses the melange runtime (github.com/pthm/melange/melange) for type definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct{}
Generator implements clientgen.Generator for Go.
func (*Generator) DefaultConfig ¶
DefaultConfig returns default configuration for Go code generation.
func (*Generator) Generate ¶
func (g *Generator) Generate(types []schema.TypeDefinition, cfg *clientgen.Config) (map[string][]byte, error)
Generate produces Go client code from the given type definitions.
Returns a single file map entry with key "schema_gen.go".
Generated code includes:
- ObjectType constants (TypeUser, TypeRepository, etc.)
- Relation constants (RelCanRead, RelOwner, etc.)
- Constructor functions (User(id), Repository(id), etc.)
- Wildcard constructors (AnyUser(), AnyRepository(), etc.)
Click to show internal directories.
Click to hide internal directories.