Documentation
¶
Overview ¶
Package qrcodes provides QR code generation for TOTP two-factor authentication setup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBuilder ¶
RegisterBuilder registers a Builder with the injector.
Types ¶
type Builder ¶
type Builder interface {
BuildQRCode(ctx context.Context, username, twoFactorSecret string) (string, error)
}
Builder generates QR codes for TOTP two-factor authentication.
type Option ¶
type Option func(*options)
Option configures the Builder this package constructs. The zero configuration works: an absent logger logs nowhere and an absent tracer provider traces nowhere.
func WithTracerProvider ¶
WithTracerProvider attaches a tracer provider, enabling spans on every operation.
type StandardBuilder ¶
type StandardBuilder struct {
// contains filtered or unexported fields
}
StandardBuilder is the one Builder implementation. It is exported, and returned by NewBuilder, so a caller can depend on the builder it built rather than on the Builder seam.
func NewBuilder ¶
func NewBuilder(issuer Issuer, opts ...Option) *StandardBuilder
NewBuilder returns a new QR code Builder.
func (*StandardBuilder) BuildQRCode ¶
func (s *StandardBuilder) BuildQRCode(ctx context.Context, username, twoFactorSecret string) (string, error)
BuildQRCode builds a QR code for a given username and secret.