Documentation ¶
Index ¶
- Variables
- func GenerateBase32EncodedString(ctx context.Context, length int) (string, error)
- func GenerateBase64EncodedString(ctx context.Context, length int) (string, error)
- func GenerateHexEncodedString(ctx context.Context, length int) (string, error)
- func GenerateRawBytes(ctx context.Context, length int) ([]byte, error)
- type Generator
Constants ¶
This section is empty.
Variables ¶
View Source
var ProvidersRandom = wire.NewSet( NewGenerator, )
ProvidersRandom are what we offer to dependency injection.
Functions ¶
func GenerateBase32EncodedString ¶
GenerateBase32EncodedString generates a one-off value with an anonymous Generator.
func GenerateBase64EncodedString ¶
GenerateBase64EncodedString generates a one-off value with an anonymous Generator.
func GenerateHexEncodedString ¶
GenerateHexEncodedString generates a one-off value with an anonymous Generator.
Types ¶
type Generator ¶
type Generator interface { GenerateHexEncodedString(ctx context.Context, length int) (string, error) GenerateBase32EncodedString(context.Context, int) (string, error) GenerateBase64EncodedString(context.Context, int) (string, error) GenerateRawBytes(context.Context, int) ([]byte, error) }
Generator should generate random strings securely.
func NewGenerator ¶
func NewGenerator(logger logging.Logger, tracerProvider tracing.TracerProvider) Generator
NewGenerator builds a new Generator.
Click to show internal directories.
Click to hide internal directories.