zstdzgo.at/zstd/zbool Index | Files

package zbool

import "zgo.at/zstd/zbool"

Package zstring implements functions for booleans.

Index

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.

Source Files

zbool.go

Version
v0.0.0-20240930202209-a63c3335042a (latest)
Published
Sep 30, 2024
Platform
linux/amd64
Imports
4 packages
Last checked
2 days ago

Tools for package owners.