rayid

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 5 Imported by: 0

README

RayID (Go)

Generate short IDs for logs, events, and traces.

go get gitlab.com/blackiq-packages/go/rayid@latest
package main

import (
	"fmt"

	"gitlab.com/blackiq-packages/go/rayid"
)

func main() {
	ray, err := rayid.New(rayid.Digit)
	if err != nil {
		panic(err)
	}

	id, err := ray.Gen(16)
	if err != nil {
		panic(err)
	}

	fmt.Println(id)
}

Types: digit · lower · upper · all

Docs

Full documentation: rayid-go.docs.amirhossein.info

Module pkg.go.dev/gitlab.com/blackiq-packages/go/rayid
Source https://gitlab.com/blackiq-packages/go/rayid

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RayID

type RayID struct {
	// contains filtered or unexported fields
}

func MustNew

func MustNew(t Type) *RayID

func New

func New(t Type) (*RayID, error)

func (*RayID) Characters

func (r *RayID) Characters() string

func (*RayID) Gen

func (r *RayID) Gen(length int) (string, error)

func (*RayID) MustGen

func (r *RayID) MustGen(length int) string

type Type

type Type string
const (
	Digit Type = "digit"
	Lower Type = "lower"
	Upper Type = "upper"
	All   Type = "all"
)

Jump to

Keyboard shortcuts

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