qr

package module
v0.0.0-...-aa585ef Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 12 Imported by: 0

README

qr

A simple web app to genrate qr codes.

Documentation

Index

Constants

View Source
const (
	TypeURL   = "url"
	TypeTel   = "tel"
	TypeSMS   = "sms"
	TypeEmail = "email"
)
View Source
const DefaultQRSize int = 600

Default size of the QR code - 601px is the breakpoint for small screens on @media queries. This will display as full size on mobile devices without compression.

Variables

View Source
var (
	ErrUnsupportedDataType error = errors.New("unsupported data type")
	ErrRequired            error = errors.New("input is required")
)

Functions

func GenerateCode

func GenerateCode(ctx context.Context, req CodeRequest) (string, error)

Types

type CodeRequest

type CodeRequest struct {
	DataType string `json:"data_type,omitempty"`
	Text     string `json:"text,omitempty"`
}

type DataType

type DataType string

type Handler

type Handler struct {
	http.Handler
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(logger *slog.Logger) *Handler

type Response

type Response struct {
	Text  string
	Code  string
	Error string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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