Documentation
¶
Index ¶
- Constants
- func Create(ctx context.Context, args ...object.Object) object.Object
- func GetOS(ctx context.Context) os.OS
- func Module() *object.Module
- func Save(ctx context.Context, args ...object.Object) object.Object
- type QRCode
- func (q *QRCode) Base64(ctx context.Context, args ...object.Object) object.Object
- func (q *QRCode) Bytes(ctx context.Context, args ...object.Object) object.Object
- func (q *QRCode) Cost() int
- func (q *QRCode) Dimension(ctx context.Context, args ...object.Object) object.Object
- func (q *QRCode) Equals(other object.Object) object.Object
- func (q *QRCode) GetAttr(name string) (object.Object, bool)
- func (q *QRCode) Inspect() string
- func (q *QRCode) Interface() interface{}
- func (q *QRCode) IsTruthy() bool
- func (q *QRCode) RunOperation(opType op.BinaryOpType, right object.Object) object.Object
- func (q *QRCode) Save(ctx context.Context, args ...object.Object) object.Object
- func (q *QRCode) SetAttr(name string, value object.Object) error
- func (q *QRCode) Type() object.Type
Constants ¶
const QRCODE object.Type = "qrcode"
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a new QR code with the given content
Arguments:
- content: the string to encode in the QR code
- options: (optional) a map of configuration options:
- encoding_mode: "numeric", "alphanumeric", or "byte"
- error_correction: "low", "medium", "high", or "highest"
- width: integer QR code width in pixels (default: 40)
func Save ¶
Save saves the QR code to a PNG file using the Risor OS
Arguments:
- qrcode: the QR code to save
- path: the file path to save the QR code to
- style_options: (optional) a map of styling options:
- bg_transparent: (bool) make the background transparent
- bg_color_hex: (string) set background color using hex color code (e.g. "#FFFFFF")
- fg_color_hex: (string) set foreground color using hex color code (e.g. "#000000")
- logo_image: (image) a Risor image object to use as a logo in the center
- shape: (string) "circle" or "rectangle" (default: "rectangle")
- border_width: (int) width of the border around the QR code
- format: (string) "png" or "jpeg" (default: "png")
Types ¶
type QRCode ¶
type QRCode struct {
// contains filtered or unexported fields
}
func (*QRCode) Base64 ¶
Base64 returns the QR code as a base64 encoded string The options map can include: - bg_transparent: (bool) make the background transparent - bg_color_hex: (string) set background color using hex color code (e.g. "#FFFFFF") - fg_color_hex: (string) set foreground color using hex color code (e.g. "#000000") - logo_image: (image) a Risor image object to use as a logo in the center - shape: (string) "circle" or "rectangle" (default: "rectangle") - border_width: (int) width of the border around the QR code - format: (string) "png" or "jpeg" (default: "png")
func (*QRCode) Bytes ¶
Bytes returns the QR code as a byte slice The options map can include: - bg_transparent: (bool) make the background transparent - bg_color_hex: (string) set background color using hex color code (e.g. "#FFFFFF") - fg_color_hex: (string) set foreground color using hex color code (e.g. "#000000") - logo_image: (image) a Risor image object to use as a logo in the center - shape: (string) "circle" or "rectangle" (default: "rectangle") - border_width: (int) width of the border around the QR code - format: (string) "png" or "jpeg" (default: "png")
func (*QRCode) Dimension ¶
Dimension implements the Dimension method of the QRCode type as a Risor method
func (*QRCode) RunOperation ¶
func (*QRCode) Save ¶
Save implements the Save method of the QRCode type as a Risor method The options map can include: - bg_transparent: (bool) make the background transparent - bg_color_hex: (string) set background color using hex color code (e.g. "#FFFFFF") - fg_color_hex: (string) set foreground color using hex color code (e.g. "#000000") - logo_image: (image) a Risor image object to use as a logo in the center - shape: (string) "circle" or "rectangle" (default: "rectangle") - border_width: (int) width of the border around the QR code - format: (string) "png" or "jpeg" (default: "png")