id

package
v3.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateRequest

type GenerateRequest struct {
	// type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit)
	Type string `json:"type"`
}

type GenerateResponse

type GenerateResponse struct {
	// the unique id generated
	Id string `json:"id"`
	// the type of id generated
	Type string `json:"type"`
}

type IdService

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

func NewIdService

func NewIdService(token string) *IdService

func (*IdService) Generate

func (t *IdService) Generate(request *GenerateRequest) (*GenerateResponse, error)

Generate a unique ID. Defaults to uuid.

func (*IdService) Types

func (t *IdService) Types(request *TypesRequest) (*TypesResponse, error)

List the types of IDs available. No query params needed.

type TypesRequest

type TypesRequest struct {
}

type TypesResponse

type TypesResponse struct {
	Types []string `json:"types"`
}

Jump to

Keyboard shortcuts

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