language which aims to simplify tasks involving defining and using data. 特徴 • 基本的にJSONのsuperset • CUE自体はGoで記述された言語 ◦ 文法的にはJSON + Go • 値のvalidationが詳細に定義可能 • 各種IDEのサポートが豊富 • Goのpackageが公式で提供されている Logo from: https://cuelang.org/
// 0 if undefined max?: number & >min // must be strictly greater than min if defined. minmax.cue type minmax struct { Min int `json:"min"` Max int `json:"max"` } func main() { data := minmax{Min: 10, Max: 100} v := cuecontext.New().CompileBytes(template) filled := v.FillPath(cue.ParsePath(""), data) compiled, err := filled.MarshalJSON() } bind.go Structから 値をバインド