videolabs/gosnow

Name: gosnow

Owner: Videolabs

Description: snowflake in golang

Created: 2015-06-22 15:43:36.0

Updated: 2015-06-22 15:43:36.0

Pushed: 2015-06-22 15:48:24.0

Homepage: null

Size: 85

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

gosnow

gosnow is a snowflake implementation in golang.

This is a fork of the upstream that replaces the the usage of panic() by returning errors instead.

age main

rt (
"github.com/sdming/gosnow"
"fmt"


 main() {

v, err := gosnow.Default()

// Alternatively you can set the worker id if you are running multiple snowflakes
// v, err := gosnow.NewSnowFlake(100)

for i := 0; i < 10; i++ {
    id, err := v.Next()
    fmt.Println(id)
}


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.