SkillAgentSearch skills...

Iceflake

iceflake is a Unique ID generator using 'snowflake' algorithm.

Install / Use

/learn @istyle-inc/Iceflake
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

iceflake

CircleCI Coverage Status

What is This

iceflake is a Unique ID generator using 'snowflake' algorithm. connect using unix domain socket(we might implement tcp connection mode optionally, also, someday), data are transferred using Protocol Buffer.

Usage

IceFlake Server

You can download from release page or go get -u github.com/istyle-inc/iceflake

$ iceflake -w 1 -s YOUR_SOCKET_FILE_PATH

"YOUR_SOCKET_FILE_PATH" here, is to be an absolute path.

IceFlake Client

Also you can use through this package. So, execute

go get -u github.com/istyle-inc/iceflake/...

and here's a client code example

client := iceflake.NewClient("unix", "YOUR_SOCKET_FILE_PATH")
flake, err := client.Get()
if err != nil {
    logger.Error("Error: Failed connect socket or get data: ", err)
}
fmt.Println(flake.GetId())

You can access "Id" on result struct, but more safety to access through GetId() func, which return zero value when receiver is nil.

License

MIT

Author

istyle inc.

Related Skills

View on GitHub
GitHub Stars8
CategoryData
Updated10mo ago
Forks1

Languages

Go

Security Score

82/100

Audited on May 13, 2025

No findings