diff --git a/README.md b/README.md index c6bc847..b475422 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ snowflake is a [Go](https://golang.org/) package that provides * Methods to parse existing snowflake IDs. * Methods to convert a snowflake ID into several other data types. * JSON Marshal/Unmarshal functions to easily use snowflake IDs within a JSON API. -* http.Handler interface to easily serve snowflake IDs over HTTP. **For help with this package or general Go discussion, please join the [Discord Gophers](https://discord.gg/0f1SbxBZjYq9jLBk) chat server.** @@ -41,7 +40,6 @@ package main import ( "fmt" - "net/http" "github.com/bwmarrin/snowflake" ) @@ -76,10 +74,6 @@ func main() { // Print out the ID's sequence number fmt.Printf("ID Step : %d\n", id.Step()) - - // Start HTTP Server for this Node on port 8080 - http.ListenAndServe(":8080", node) - } ``` diff --git a/snowflake.go b/snowflake.go index 301f520..2cf395c 100644 --- a/snowflake.go +++ b/snowflake.go @@ -4,7 +4,6 @@ package snowflake import ( "encoding/base64" "fmt" - "net/http" "strconv" "strings" "sync" @@ -86,15 +85,6 @@ func (n *Node) Generate() (ID, error) { ), nil } -func (n *Node) ServeHTTP(w http.ResponseWriter, r *http.Request) { - - id, err := n.Generate() - if err != nil { - http.Error(w, "Internal Error", 500) - } - fmt.Fprint(w, id) -} - // Int64 returns an int64 of the snowflake ID func (f ID) Int64() int64 { return int64(f)