snowflake

package
v0.0.0-...-2680af6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Introduction

A wrapper for the package https://github.com/bwmarrin/snowflake

Usage

Just import the package into the file to use it.

Example Program:

package foo

import (
 "fmt"

 "go.tekoapis.com/tekone/library/util/snowflake"
)

func doSomething() {

    // generate snowflake ID
    id, err := snowflake.NextID()
    if err != nil {
        // handle err
    }

    // use generated id to do something
    ....
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextID

func NextID() (int64, error)

NextID generates an unique int64 of the snowflake ID Ex: 587159296175034368

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL