mirror of
https://github.com/sony/sonyflake.git
synced 2026-12-01 17:49:32 +00:00
1 parent
848d664cee
commit
809c515cc5
4 files changed
+28
-18
No files matched your search
@@ -0,0 +1,24 @@
|
|||||||
|
on: [push, pull_request]
|
||||||
|
name: Test
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.18.x, 1.19.x]
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
steps:
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{matrix.go-version}}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: gofmt
|
||||||
|
run: test -z "`gofmt -l .`"
|
||||||
|
- name: golint
|
||||||
|
run: test -z "`golint ./...`"
|
||||||
|
- name: go test
|
||||||
|
run: go test -v ./...
|
||||||
|
- name: Build example
|
||||||
|
run: cd example && ./linux64_build.sh
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
language: go
|
|
||||||
go:
|
|
||||||
- 1.13.x
|
|
||||||
- 1.14.x
|
|
||||||
before_install:
|
|
||||||
- go get -u golang.org/x/lint/golint
|
|
||||||
- go get github.com/axw/gocov/gocov
|
|
||||||
- go get github.com/mattn/goveralls
|
|
||||||
script:
|
|
||||||
- test -z "`gofmt -l .`"
|
|
||||||
- test -z "`golint ./...`"
|
|
||||||
- $GOPATH/bin/goveralls -service=travis-ci
|
|
||||||
- cd example && ./linux64_build.sh
|
|
||||||
@@ -2,8 +2,6 @@ Sonyflake
|
|||||||
=========
|
=========
|
||||||
|
|
||||||
[](http://godoc.org/github.com/sony/sonyflake)
|
[](http://godoc.org/github.com/sony/sonyflake)
|
||||||
[](https://travis-ci.org/sony/sonyflake)
|
|
||||||
[](https://coveralls.io/github/sony/sonyflake?branch=master)
|
|
||||||
[](https://goreportcard.com/report/github.com/sony/sonyflake)
|
[](https://goreportcard.com/report/github.com/sony/sonyflake)
|
||||||
|
|
||||||
Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake).
|
Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake).
|
||||||
|
|||||||
+4
-3
@@ -1,9 +1,10 @@
|
|||||||
// Package sonyflake implements Sonyflake, a distributed unique ID generator inspired by Twitter's Snowflake.
|
// Package sonyflake implements Sonyflake, a distributed unique ID generator inspired by Twitter's Snowflake.
|
||||||
//
|
//
|
||||||
// A Sonyflake ID is composed of
|
// A Sonyflake ID is composed of
|
||||||
// 39 bits for time in units of 10 msec
|
//
|
||||||
// 8 bits for a sequence number
|
// 39 bits for time in units of 10 msec
|
||||||
// 16 bits for a machine id
|
// 8 bits for a sequence number
|
||||||
|
// 16 bits for a machine id
|
||||||
package sonyflake
|
package sonyflake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
Reference in new issue
Block a user