utils

package
v0.0.0-...-2ffb769 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNonce

func GetNonce() string

GetNonce is a naive nonce producer that takes the current Unix nano epoch and counts upwards. This is a naive approach because the nonce bound to the currently used API key and as such needs to be synchronised with other instances using the same key in order to avoid race conditions.

Types

type EpochNonceGenerator

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

func NewEpochNonceGenerator

func NewEpochNonceGenerator() *EpochNonceGenerator

func (*EpochNonceGenerator) GetNonce

func (u *EpochNonceGenerator) GetNonce() string

GetNonce is a naive nonce producer that takes the current Unix nano epoch and counts upwards. This is a naive approach because the nonce bound to the currently used API key and as such needs to be synchronised with other instances using the same key in order to avoid race conditions.

type NonceGenerator

type NonceGenerator interface {
	GetNonce() string
}

Jump to

Keyboard shortcuts

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