{"id":22669419,"url":"https://github.com/stefanhans/golang-contexting","last_synced_at":"2026-05-06T07:31:26.873Z","repository":{"id":57547785,"uuid":"81069724","full_name":"stefanhans/golang-contexting","owner":"stefanhans","description":"Reference Implementation for Contextinformation Routing Network (CRN)","archived":false,"fork":false,"pushed_at":"2017-05-20T11:08:08.000Z","size":302,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T10:50:00.512Z","etag":null,"topics":["context-aware","golang","isomorphic","location-based","overlay-network","peer-to-peer","reactive"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefanhans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-06T09:22:15.000Z","updated_at":"2024-03-23T11:35:15.000Z","dependencies_parsed_at":"2022-09-26T22:20:22.025Z","dependency_job_id":null,"html_url":"https://github.com/stefanhans/golang-contexting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhans%2Fgolang-contexting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhans%2Fgolang-contexting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhans%2Fgolang-contexting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhans%2Fgolang-contexting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanhans","download_url":"https://codeload.github.com/stefanhans/golang-contexting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174607,"owners_count":20735417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context-aware","golang","isomorphic","location-based","overlay-network","peer-to-peer","reactive"],"created_at":"2024-12-09T15:30:44.053Z","updated_at":"2026-05-06T07:31:26.801Z","avatar_url":"https://github.com/stefanhans.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reference Implementation of Contextinformation Routing Networks in Go\n[![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/stefanhans/golang-contexting/blob/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/stefanhans/golang-contexting/ctx?status.svg)](https://godoc.org/github.com/stefanhans/golang-contexting/ctx)\n[![Go Report Card](https://goreportcard.com/badge/github.com/stefanhans/golang-contexting)](https://goreportcard.com/report/github.com/stefanhans/golang-contexting)\n![Under Construction](images/under_construction.jpg)![Experimental](images/experimental_small.png)\n\nContextinformation Routing Network (CRN) is a communication framework enabling\na universal service to join matching contextinformation respectively its\ncommunication partners.\n\nThe concept and the specifications are described in RFC documents:\n\n * [CRN Concepts](https://raw.githubusercontent.com/stefanhans/golang-contexting/master/RFC/CRN_Concepts.txt)\n (in large parts completed)\n\n * [CIP Specification](https://raw.githubusercontent.com/stefanhans/golang-contexting/master/RFC/CIP_Specification.txt)\n (in large parts completed)\n\n * [CIR Specification](https://raw.githubusercontent.com/stefanhans/golang-contexting/master/RFC/CIR_Specification.txt)\n (not yet mature)\n\nThese documents are still drafts and will be finalized if the reference implementation will be.\n\n\n---\nThe main components of CRNs are the following:\n\n### Contextinformation (CI)\n![Info](images/info_small.jpg)\nContextinformation (CI) refers mainly to the known terms information and context.\nDue to the lack of a useful clear distinction between the two, CI is defined\nhere as information within its described context, i.e. context becomes part of\nCI by describing it.\nAnother aspect of CI is the accuracy with regard to possible matches with other\nCI. All of these has to be converted into a general format, in which the actual\nmeaning is not relevant to find matching CI.\n\n### Contextinformation Coding (CIC)\n![Coding](images/binary.png)\nContextinformation Coding (CIC)is the conversion of CI into a binary format\nand vice versa.  CIC means both, the conversion rules (CIC-Ruleset) for a\nparticular type of CI and a concrete piece of encoded CI.\nEvery CIC has an identifier, called CIC-Number.\nA CIC-Ruleset and all its encoded CI are linked by this CIC-Number. Encoded CI\nhas the form of two parallel bit strings of equal length.  This pair\nconsists of CIC-Content, an instance of the CIC-Ruleset, and CI-Mask, which is\nused to define the accuracy of the searched match.  Then it is sufficient for\na bitwise match of two pieces of CI if both CIC-Contents are equal or both\nCI-Masks mark them as non-relevant.\n\nThe calculation of such a match between two CIs uses the following function\nor bitwise expression, respectively\n\n    match(Offer, Request) = (NOT (Offer-Content XOR Request-Content)) OR (Offer-Mask AND Request-Mask)\n\n\nLet me illustrate this with an example.\nOffer and Request are two communication roles, and Location is the type of CI.\nOffer says \"I'm available for any Request with matching location (CI) to contact me\" and\nRequest says \"I'm searching for any Offer with matching location (CI)\".\nBoth have an exact information about their location and can define a\nsurrounding area where Offer is available respectively Request is searching.\nCIC-Content, as the encoded location, together with CI-Mask defines the\nsurrounding area by marking bits of CIC-Content as true in any case concerning\nthe match.  Here the CI of Offer and Request are matching if the location of\none is in the surrounding area of the other and vice versa.\n\n### Contextinformation Packet (CIP)\n![Packet](images/packet.png)\nEncoded CI is encapsulated in a data structure named Contextinformation Packet (CIP).\nA CIP is divided into three parts:\n\n * Header Data\n (static and dynamic)\n\n * Contextinformation\n (mainly dynamic)\n\n * Application Data\n (mainly dynamic)\n\nAll information which has to be transferred inside CRNs has to be encapsulated\nwithin CIPs.\n\n### Contextinformation Routing (CIR)\n![Routing](images/network.png)\nContextinformation Routing (CIR) takes place in an overlay network built\nnormally on top of the TCP/IP layer. It is organized basically by using\nCIC-Content as an index. It is oriented towards known concepts of network routing,\npeer-to-peer and others network principles and B-tree like data structures.\n\nAdditionally, it is committing to the four properties of reactive systems as described\nin the [Reactive Manifesto](http://www.reactivemanifesto.org/):\n\n![Reactive Manifesto](http://www.reactivemanifesto.org/images/reactive-traits.svg)\n\n\n---\n### Reference Implementation in Go\n\n\nThe goal of the reference implementation in Go is an open, unlimited and reactive\npeer-to-peer overlay network design for all binary encodable kind of contextinformation\nto connect its participants accordingly.\n\n![doc](images/doc.png)\n\nThe implementation guidelines, additionally to the idiomatic Go ones, are\nthe so-called SOLID principles - originally for object-oriented design, but adapted for Go\nas [SOLID Go Design](https://dave.cheney.net/2016/08/20/solid-go-design):\n\n * **S**ingle responsibility principle\n * **O**pen / Closed Principle\n * **L**iskov Substitution Principle\n * **I**nterface Segregation Principle\n * **D**ependency Inversion Principle\n\n### Backend Packages and API\n![pkg](images/pkg.png)\n\nThe infrastructure, namely Contextinformation Packet (CIP) and Contextinformation Routing (CIR),\nwill be implemented in Go packages. The API for the Contextinformation Coding (CIC) and the applications\nwill follow afterwards. Concerning simplicity and conciseness of the API, the complete backend\nshall be oriented towards the standard library of Go.\n\n\n### Application Prototypes\n\nThe prototypes for application testing and demonstration will be a kind of the standard distributed applications - chats.\nThese chats will have an isomorphic code model and will be flexible concerning their Contextinformation Codings.\n\n![Chat](images/chat_small.png)\n\nThe following frontends are planned:\n\n * Command-Line (mainly for backend testing)\n * Browser ([GopherJS](https://github.com/gopherjs/gopherjs))\n * Android ([golang/mobile](https://github.com/golang/mobile))\n * iOS ([golang/mobile](https://github.com/golang/mobile))\n * Desktop ([GUI library](https://github.com/avelino/awesome-go#gui) still under investigation)\n\n![CMD](images/cmd_small.png) ![Browser](images/js_small.png) ![Android](images/android_small.png)\n![iOS](images/ios_small.png) ![Desktop](images/desktop_small.jpg)\n\n---\n\n### Current Status\n![Gopher](images/gopher_fan.png)\n\nAt the moment I'm\n\n * hoping to get CIR as topic for my thesis at the FernUniversität Hagen\n * trying to become a native Go speaker and to find a good design for the\n [backend packages](https://godoc.org/github.com/stefanhans/golang-contexting/ctx) and the API\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanhans%2Fgolang-contexting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanhans%2Fgolang-contexting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanhans%2Fgolang-contexting/lists"}