Skip to content

Commit

Permalink
[PoC] Use cog to generate go and typescript models + resources
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen committed Jun 3, 2024
1 parent 9481a3e commit cb5ece7
Show file tree
Hide file tree
Showing 10 changed files with 548 additions and 640 deletions.
16 changes: 8 additions & 8 deletions codegen/cuekind/testing/cuestomkind2.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ customKind2: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
} @cuetsy(kind="interface")
}
#InnerObject2: {
name: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
}
#Type1: {
group: string
options?: [...string]
} @cuetsy(kind="interface")
}
#Type2: {
group: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
#UnionType: #Type1 | #Type2 @cuetsy(kind="type")
}
#UnionType: #Type1 | #Type2
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time @cuetsy(kind="string")
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum")
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default"
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
}
}
}
}
16 changes: 8 additions & 8 deletions codegen/cuekind/testing/customkind.cue
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ customKind: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
} @cuetsy(kind="interface")
}
#InnerObject2: {
name: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
}
#Type1: {
group: string
options?: [...string]
} @cuetsy(kind="interface")
}
#Type2: {
group: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
#UnionType: #Type1 | #Type2 @cuetsy(kind="type")
}
#UnionType: #Type1 | #Type2
spec: {
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time @cuetsy(kind="string")
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum")
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum",memberNames="val1|val2|val3|val4|default")
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
Expand All @@ -64,4 +64,4 @@ customKind: {
}
}
}
}
}
293 changes: 0 additions & 293 deletions codegen/jennies/dstutil.go

This file was deleted.

Loading

0 comments on commit cb5ece7

Please sign in to comment.