diff --git a/Data-Structure.md b/Data-Structure.md deleted file mode 100644 index 882144d..0000000 --- a/Data-Structure.md +++ /dev/null @@ -1,9 +0,0 @@ -# Giti Data Structure - -## ID -- To have canonical data structure IDs calculate it from hash of URN. -- ID is first 64bit of SHA-512 hash of data structure URN! -- Zero ID means no data structure! - -## URN -`urn:giti:{{domain-name}}:data-structure:{{data-store-name}}` diff --git a/Error.md b/Error.md deleted file mode 100644 index 523f5f4..0000000 --- a/Error.md +++ /dev/null @@ -1,9 +0,0 @@ -# Giti Error - -## ID -- To have canonical error IDs calculate it from hash of URN. -- ID is first 64bit of SHA-512 hash of error URN! -- Zero ID means no error! - -## URN -`urn:giti:{{domain-name}}:error:{{error-name}}` diff --git a/Service.md b/Service.md deleted file mode 100644 index 0ffafd8..0000000 --- a/Service.md +++ /dev/null @@ -1,10 +0,0 @@ -# Giti Service - - -## ID -- To have canonical error IDs calculate it from hash of URN. -- ID is first 64bit of SHA-512 hash of service URN! -- Zero ID means no service! - -## URN -`urn:giti:{{domain-name}}:service:{{service-name}}` diff --git a/media-type.md b/media-type.md new file mode 100644 index 0000000..292fe94 --- /dev/null +++ b/media-type.md @@ -0,0 +1,33 @@ +## Media Type Extension +Want a protocol to declare global service, error, ... in any language with desire goals, So we decide to add new main-type to media-type URI scheme instead invent from scratch. Add new top-level type names (main-type) as `domain` instead of `application` to have proper way to indicate domain specific media types. + +## Structure +`type "/" [tree "."] subtype ["+" suffix]* [";" parameters]` +`domain/{{domain-name}}. {{structure-type}} +{{codec-type}} ;{{structure-name}}` +`domain/sabz.city.storage+syllab; quiddity` +- **domain-name** as a tree for a organization by its domain name. +- **structure-type** or structure scope like `storage`, `service`, `error`, `page`, `widget`, ... +- **codec-type** like `syllab`, `json`, `xml`, `protobuf`, `flatbuf`, `html`, ... +- **structure-name** must be unique in the domain scope e.g. "product" in the "page" scope of the domain. e.g. `log`, `get-email`, `get-email`, `request`, `response`, `not-standard-structure-id`, ... Due to RFC rules, a media-type can has more than one parameters, so you can easily add more than one if need it like http that use `charset=` and `boundary=` in content-type header. + +## ID +- To have canonical structure IDs calculate it from hash of MediaType(). +- ID is first 64bit of SHA3-256 hash of structure that transfer in base64 if protocol is string base. +- Zero ID means no data structure e.g. no error, .... + +## Goals +- Easily generate SDK in any programing language +- Transfer and retrieve by ID in any protocol +- Store locale detail not just english detail +- + +## Other ways +- use URN standard like `urn:giti:sabz.city:page:login` as `urn:giti:{{domain-name}}:{{structure-type}}:{{structure-name}}` + +## RFCs +- https://datatracker.ietf.org/doc/html/rfc6838 +- https://datatracker.ietf.org/doc/html/rfc2046 +- https://datatracker.ietf.org/doc/html/rfc2609 + +## Resources +- https://en.wikipedia.org/wiki/Media_type