You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package call |
|
|
|
import ( |
|
"github.com/bwmarrin/snowflake" |
|
) |
|
|
|
var ( |
|
snowNode *snowflake.Node |
|
) |
|
|
|
func NewSnowflake(id int64) { |
|
id = id % 1023 |
|
var err error |
|
snowNode, err = snowflake.NewNode(id) |
|
if err != nil { |
|
panic(err) |
|
} |
|
} |
|
|
|
func SnowNode() *snowflake.Node { |
|
return snowNode |
|
}
|
|
|