diff options
| -rw-r--r-- | doc/404.html | 34 | ||||
| -rw-r--r-- | doc/css/style.css | 3 | ||||
| -rw-r--r-- | doc/index.html | 194 | ||||
| -rw-r--r-- | doc/robots.txt | 4 | ||||
| -rw-r--r-- | doc/sitemap.xml | 5 |
5 files changed, 0 insertions, 240 deletions
diff --git a/doc/404.html b/doc/404.html deleted file mode 100644 index d4e6678..0000000 --- a/doc/404.html +++ /dev/null @@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <title>Clawflake</title> - <meta name="author" content="Nicolas Paul" /> - <meta name="description" content="A generation system with time-sortable keys." /> - <meta name="keywords" content="clawflake,discord,twitter,id,generator,specification,distributed" /> - <meta name="referrer" content="origin" /> - <meta name="theme-color" content="#dc8400" /> - <meta name="color-scheme" content="light dark" /> - <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=yes" /> - <meta name="creator" content="Nicolas Paul" /> - <meta name="googlebot" content="all" /> - <meta name="publisher" content="Nicolas Paul" /> - <meta name="robots" content="all" /> - <link rel="sitemap" href="/sitemap.xml" /> - <meta property="og:site_name" content="Nicolas Paul" /> - <link rel="stylesheet" href="https://fashion-pepper.nc0.fr/css/fashion-pepper.css"> - <link rel="stylesheet" href="css/style.css"> -</head> - -<body> - <main> - <h1>Not Found</h1> - <p>The requested URL was not found on this server.</p> - - <p>Try the <a href="/">home page</a> first!</p> - </main> -</body> - -</html>
\ No newline at end of file diff --git a/doc/css/style.css b/doc/css/style.css deleted file mode 100644 index dca12aa..0000000 --- a/doc/css/style.css +++ /dev/null @@ -1,3 +0,0 @@ -:root { - --accent-color: #dc8400; -}
\ No newline at end of file diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index 1af5515..0000000 --- a/doc/index.html +++ /dev/null @@ -1,194 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <title>Clawflake</title> - <meta name="author" content="Nicolas Paul" /> - <meta name="description" content="A generation system with time-sortable keys." /> - <meta name="keywords" content="clawflake,discord,twitter,id,generator,specification,distributed" /> - <meta name="referrer" content="origin" /> - <meta name="theme-color" content="#dc8400" /> - <meta name="color-scheme" content="light dark" /> - <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=yes" /> - <meta name="creator" content="Nicolas Paul" /> - <meta name="googlebot" content="all" /> - <meta name="publisher" content="Nicolas Paul" /> - <meta name="robots" content="all" /> - <link rel="sitemap" href="/sitemap.xml" /> - <meta name="twitter:card" content="summary_large_image" /> - <meta name="twitter:site" content="@ncs_pl" /> - <meta name="twitter:creator" content="@ncs_pl" /> - <meta name="twitter:title" content="Clawflake" /> - <meta name="twitter:description" content="A generation system with time-sortable keys." /> - <meta property="og:title" content="Clawflake" /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://clawflake.nc0.fr/" /> - <meta property="og:description" content="A generation system with time-sortable keys." /> - <meta property="og:determiner" content="" /> - <meta property="og:locale" content="en" /> - <meta property="og:site_name" content="Nicolas Paul" /> - <link rel="stylesheet" href="https://fashion-pepper.nc0.fr/css/fashion-pepper.css"> - <link rel="stylesheet" href="css/prism.css"> - <link rel="stylesheet" href="css/style.css"> - <script src="js/prism.js"></script> -</head> - -<body> - <header> - <nav> - <ul> - <li><strong>Clawflake</strong></li> - <li><a href="/">Home</a></li> - <li><a href="#license">License</a></li> - </ul> - </nav> - </header> - <main> - <h1 id="clawflake">Clawflake</h1> - <p>Clawflake is a distributed ID number generation system inspired from - <a href="https://github.com/twitter-archive/snowflake/tree/snowflake-2010"> - Twitter's Snowflake</a>. - </p> - - <p> The goal of Clawflake is to be hosted as a distributed system with - all workers being isolated from each others apart from the machine ID. - </p> - - <h2 id="format">Format</h2> - - <p> - Unlike Snowflake, the composition of a Clawflake uses all 64 bits. - </p> - - <table> - <thead> - <tr> - <th scope="col">#</th> - <th scope="col">Name</th> - <th scope="col">Bits</th> - <th scope="col">Description</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">1</th> - <td><code>time</code></td> - <td><code>45</code></td> - <td><code>The number of milliseconds passed from a configured epoch.</code></td> - </tr> - <tr> - <th scope="row">2</th> - <td><code>sequence</code></td> - <td><code>12</code></td> - <td><code>A sequence number rolling out whenever required.</code></td> - </tr> - <tr> - <th scope="row">3</th> - <td><code>machine</code></td> - <td><code>7</code></td> - <td><code>An identifier for the worker, between 0 and 127.</code></td> - </tr> - </tbody> - </table> - - <p> - Therefore, Clawflake ID numbers gives <mark>2<sup>45</sup> - 1 = 1115.7</mark> years - of safety from the configured epoch. - Thanks to the sequence number, a worker can handle <mark>2<sup>12</sup> = 4069</mark> - generations per milliseconds at peak. - The system can accept a maximum of <mark>2<sup>7</sup> = 128</mark> machines for a - given epoch. - </p> - - <cite> - Since Clawflake uses the most significant bit, converting a Clawflake ID - from <i>uint64</i> to <i>int64</i> is not safe. - </cite> - - <h2>Usage</h2> - - <p> - Before launching any worker, you need to determine the following - information: - - <ul> - <li><i>epoch</i>: corresponds to the epoch workers will be using to - generate IDs.</li> - <li><i>machine</i>: the identifier for the machine.</li> - </ul> - </p> - - <p> - Due to the format of a Clawflake, you can only have 128 workers (machine IDs - between 0 and 127). - </p> - - <p> - You can compile the worker by running the following command: - </p> - - <pre><code lang="language-bash"> - make generator - </code></pre> - - </p> - This will generate an executable named <code>generator</code> inside the - <code>bin</code> directory. - </p> - - <p> - You can then start the worker by running: - - <pre><code class="language-bash"> - export MACHINE_ID= # Worker ID, between 0 and 127 - export EPOCH= # Epoch to use in ID generation - ./bin/generator -machine_id=$MACHINE_ID -epoch=$EPOCH -grpc_host=":5000" - </code></pre> - </p> - - <p> - <strong>TIP:</strong> Use the flag <code>-help</code> to view the - documentation for the flags. - </p> - - <p> - A worker should be running on port <code>5000</code>. You can try generating some - Clawflake ID numbers using the - <a - href="https://github.com/n1c00o/clawflake/blob/master/api/nicolaspl/clawflake/generator/v3/generator.proto"> - Generator API - </a>. - </p> - - <p>A test client is available in <a - href="https://github.com/n1c00o/clawflake/blob/master/cmd/testclient/main.go">cmd/testclient/main.go</a>. - </p> - - <h2 id="license">License</h2> - <p> - Clawflake is governed by a BSD-style license that can be found in the - <a href="https://github.com/n1c00o/clawflake/blob/master/LICENSE"><code>LICENSE</code></a> file. - </p> - - <p> - The older codebase was licensed by the Apache License, Version 2.0, however - none of the old code still exists. - </p> - </main> - - <footer> - <hr /> - - <ul> - <li><a href="/">Website</a></li> - <li><a href="https://github.com/n1c00o/clawflake" target="_blank">Source</a></li> - <li><a href="https://nc0.fr" target="_blank">Nicolas Paul</a></li> - </ul> - - <p>© 2023</p> - </footer> -</body> - -</html>
\ No newline at end of file diff --git a/doc/robots.txt b/doc/robots.txt deleted file mode 100644 index 922ec26..0000000 --- a/doc/robots.txt +++ /dev/null @@ -1,4 +0,0 @@ -User-Agent: * -Allow: / - -Sitemap: https://clawflake.nicolaspl.com/sitemap.xml
\ No newline at end of file diff --git a/doc/sitemap.xml b/doc/sitemap.xml deleted file mode 100644 index e3e71be..0000000 --- a/doc/sitemap.xml +++ /dev/null @@ -1,5 +0,0 @@ -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> - <url> - <loc>https://clawflake.nicolaspl.com/</loc> - </url> -</urlset>
\ No newline at end of file |
