id

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: LGPL-2.1 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IGenerator

type IGenerator interface {
	Snapshot() ([]byte, error)
	New() Id
}

type IGeneratorBuilder

type IGeneratorBuilder interface {
	NewIdGenerator(ctx context.Context, tracer tracing.ITracer) (IGenerator, error)
	RestoreIdGenerator(ctx context.Context, serialized []byte, tracer tracing.ITracer) (IGenerator, error)
}
var DefaultIdGeneratorBuilder IGeneratorBuilder

type Id

type Id interface {
	Bytes() []byte
	String() string
}

type Sno

type Sno struct{}

func GetSno

func GetSno() *Sno

func (*Sno) NewIdGenerator

func (g *Sno) NewIdGenerator(ctx context.Context, tracer tracing.ITracer) (result IGenerator, err error)

func (*Sno) RestoreIdGenerator

func (g *Sno) RestoreIdGenerator(ctx context.Context, bytes []byte, tracer tracing.ITracer) (result IGenerator, err error)

type SnoGenerator

type SnoGenerator struct {
	*sno.Generator
	// contains filtered or unexported fields
}

func (*SnoGenerator) New

func (g *SnoGenerator) New() Id

func (*SnoGenerator) Snapshot

func (g *SnoGenerator) Snapshot() (result []byte, err error)

type SnoId

type SnoId struct {
	sno.ID
}

func (*SnoId) Bytes

func (id *SnoId) Bytes() []byte

func (*SnoId) String

func (id *SnoId) String() string

Jump to

Keyboard shortcuts

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