newtype

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: GPL-3.0 Imports: 5 Imported by: 1

README

بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيْمِ


السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ


ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ


اللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا صَلَّيْتَ عَلَى إِبْرَاهِيمَ وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ ، اللَّهُمَّ بَارِكْ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا بَارَكْتَ عَلَى إِبْرَاهِيمَ ، وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ

newtype

Custom type for special cases in golang.

Documentation

Index

Constants

View Source
const (
	DefaultBase    = 10
	DefaultBitSize = 64
)

List of default values used for this package.

Variables

This section is empty.

Functions

func IsNullJSON added in v1.2.0

func IsNullJSON(in []byte) bool

func IsStringJSON added in v1.2.0

func IsStringJSON(in []byte) bool

func RemoveQuotesJSON added in v1.2.0

func RemoveQuotesJSON(in []byte) []byte

Types

type Bool

type Bool bool

Bool is a custom defined type for bool.

func (*Bool) FromDB added in v1.0.2

func (b *Bool) FromDB(value []byte) (err error)

FromDB implementing Conversion interface for xorm.

func (Bool) MarshalJSON

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

MarshalJSON implements the MarshalJSON interface.

func (*Bool) Scan added in v1.0.1

func (b *Bool) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (Bool) ToDB added in v1.0.2

func (b Bool) ToDB() (val []byte, err error)

ToDB implementing Conversion interface for xorm.

func (*Bool) UnmarshalJSON

func (b *Bool) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON implementing UnmarshalJSON interface.

func (Bool) Value added in v1.0.1

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

Value implements the driver Valuer interface.

type String added in v1.3.0

type String string

String represents the string type that can be converted to any type.

func (String) Int added in v1.3.0

func (s String) Int() (int, error)

Int returns the int value of the string and the error of parsing.

func (String) IntOnly added in v1.3.0

func (s String) IntOnly() int

IntOnly returns the int value of the string.

func (String) MarshalJSON added in v1.3.0

func (s String) MarshalJSON() (res []byte, err error)

MarshalJSON implements the json.Marshaler interface.

func (*String) Scan added in v1.3.0

func (s *String) Scan(value interface{}) (err error)

Scan implements the sql.Scanner interface.

func (String) String added in v1.3.0

func (s String) String() string

String implements the fmt.Stringer interface.

func (String) Uint added in v1.3.0

func (s String) Uint() (uint64, error)

Uint returns the uint value of the string and the error of parsing.

func (String) UintOnly added in v1.3.0

func (s String) UintOnly() uint64

UintOnly returns the uint value of the string.

func (*String) UnmarshalJSON added in v1.3.0

func (s *String) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface.

func (String) Value added in v1.3.0

func (s String) Value() (res driver.Value, err error)

Value implements the driver.Valuer interface.

Jump to

Keyboard shortcuts

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