randid

package module
v0.0.0-...-4d762b5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 8 Imported by: 0

README

randid

Build Status Go Report Card GoDoc

Random ID generator using timestamp as prefix

Installation

go get github.com/moonrhythm/randid

Usage

package main

import (
    "fmt"

    "github.com/moonrhythm/randid"
)

func main() {
    id := randid.MustGenerate().String()
    fmt.Println(id)
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID [16]byte

func FromString

func FromString(s string) (ID, error)

func Generate

func Generate() (ID, error)

func MustGenerate

func MustGenerate() ID

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

func (*ID) Scan

func (id *ID) Scan(src interface{}) error

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(b []byte) error

func (ID) Value

func (id ID) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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