Golang implementation for Concise Data Definition Language (CDDL). CDDL is an IETF standard whose main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.
Warning
This repository is still in active development and may introduce breaking changes. Do not use in production
go get -u github.com/HannesKimara/cddlc
go install github.com/HannesKimara/cddlc/cmd/cddlc@latest
To get started using the parser library visit the docs. The docs to the cddlc
tool are available here
CDDL | Parser | Code Generator |
---|---|---|
identifiers ( basic , hyphen-separated , *weird..ones ...) |
☑ | ☑* |
primitives ( bool , false , true , tstr , text , "text_literal" , float , float16 , float32 , float64 , uint , int , nint , bstr , bytes , null/nil ) |
☑ | ☑ |
occurrence operators ( * , + , ? ) |
☑ | ☐ |
choice operators ( / , // ) |
☑ | ☐ |
composition operators ( ~ ) |
☑ | ☐ |
comparable control operators ( .lt , .le , .gt , .ge , .eq , .ne ) |
☑ | ☐ |
constraint control operators ( .size , .regexp ) |
☑ | ☐ |
collections ( groups () , arrays [] , structs {} ) |
☑ | ☐ |
Note
*
means that the cddl construct may not be fully supported in a particular context such as identifer translation during code generation.
This project is licensed under the Apache-2.0 license. Please see the LICENSE file for more details.