idgener

package
v0.0.0-...-0aec761 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package idgener can generate ids.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDGener

type IDGener interface {
	io.Closer
	// The first is 1.
	GenID(ctx context.Context) (id int64, err error)
}

func NewMemoryGener

func NewMemoryGener() IDGener

This gener never fails.

func NewRedisGener

func NewRedisGener(server, password, idkey string,
	maxConcurrent int) (IDGener, error)

If password isnot empty, then do AUTH.

func NewSqlGener

func NewSqlGener(driver, dsn, tn string,
	maxConcurrent int) (IDGener, error)

Jump to

Keyboard shortcuts

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