zbool

package
v0.0.0-...-d785515 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Overview

Package zstring implements functions for booleans.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

Bool converts various types to a boolean.

It's always stored as an integer in the database (the only cross-platform way in SQL).

Supported types:

bool
int* and float*     0 or 1
[]byte and string   "1", "true", "on", "0", "false", "off"
nil                 defaults to false

func (Bool) Bool

func (b Bool) Bool() bool

func (Bool) MarshalJSON

func (b Bool) MarshalJSON() ([]byte, error)

MarshalJSON converts the data to JSON.

func (Bool) MarshalText

func (b Bool) MarshalText() ([]byte, error)

MarshalText converts the data to a human readable representation.

func (*Bool) Scan

func (b *Bool) Scan(src any) error

Scan converts the data from the DB.

func (*Bool) UnmarshalJSON

func (b *Bool) UnmarshalJSON(text []byte) error

UnmarshalJSON converts the data from JSON.

func (*Bool) UnmarshalText

func (b *Bool) UnmarshalText(text []byte) error

UnmarshalText parses text in to the Go data structure.

func (Bool) Value

func (b Bool) Value() (driver.Value, error)

Value converts a bool type into a number to persist it in the database.

Jump to

Keyboard shortcuts

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