-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add several pieces of docs to schema/dmt.
Package docs are important to have as overviews, and we were previously missing any. Added a few notes to any future hackers, as well. Removed the "export" file that was only used by the generator gadget. I don't believe it worked anyway. It wasn't exercised in CI because of the build tags. And since it was first written, we've relaxed on what we allow to be exported anyway, and the field that file contained a build-tag-fenced accessor for is simply available anyway. So, I updated the codegen gadget to just use that directly. No sweat.
- Loading branch information
Showing
5 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Package schema/dmt contains types and functions for dealing with the data model form of IPLD Schemas. | ||
(DMT is short for "data model tree" -- see https://ipld.io/glossary/#dmt .) | ||
As with anything that's IPLD data model, this data can be serialized or deserialized into a wide variety of codecs. | ||
To contrast this package with some of its neighbors and with some various formats for the data this package describes: | ||
Schemas also have a DSL (a domain-specific language -- something that's meant to look nice, and be easy for humans to read and write), | ||
which are parsed by the `schema/dsl` package, and produce a DMT form (defined by and handled by this package). | ||
Schemas also have a compiled form, which is the in-memory structure that this library uses when working with them; | ||
this compiled form differs from the DMT because it can use pointers (and that includes cyclic pointers, which is something the DMT form cannot contain). | ||
We use the DMT form (this package) to produce the compiled form (which is the `schema` package). | ||
Creating a Compiled schema either flows from DSL(text)->`schema/dsl`->`schema/dmt`->`schema`, | ||
or just (some codec, e.g. JSON or CBOR or etc)->`schema/dmt`->`schema`. | ||
The `dmt.Schema` type describes the data found at the root of an IPLD Schema document. | ||
The `Compile` function turns such data into a `schema.TypeSystem` that is ready to be used. | ||
The `dmt.Prototype.Schema` value is a NodePrototype that can be used to handle IPLD Schemas in DMT form as regular IPLD Nodes. | ||
Typically this package is imported aliased as "schemadmt", | ||
since "dmt" is a fairly generic term in the IPLD ecosystem | ||
(see https://ipld.io/glossary/#dmt ). | ||
*/ | ||
package dmt |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters