idgen

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package idgen GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectContext

func InjectContext(ctx context.Context, gen Gen) context.Context

func ResolveExposedIP

func ResolveExposedIP() net.IP
Example
ResolveExposedIP()
Output:

Types

type Gen

type Gen interface {
	ID() (uint64, error)
}

func FromContext

func FromContext(ctx context.Context) Gen

func New

func New() (Gen, error)

type IDGen

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

func (*IDGen) Init

func (i *IDGen) Init(ctx context.Context) error

func (*IDGen) InjectContext

func (i *IDGen) InjectContext(ctx context.Context) context.Context

type TypedGen

type TypedGen[ID ~uint64] interface {
	ID() (ID, error)
}

func Cast

func Cast[ID ~uint64](gen Gen) TypedGen[ID]

func FromContextAndCast

func FromContextAndCast[T ~uint64](ctx context.Context) TypedGen[T]

Jump to

Keyboard shortcuts

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