jsonutils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SQLByte

func SQLByte(src interface{}) ([]byte, error)

func UnmarshalFromSQL

func UnmarshalFromSQL(target, source interface{}) error

func UnquoteBytes

func UnquoteBytes(s []byte) (t []byte, ok bool)

Types

type Bytes

type Bytes []byte

func (Bytes) Get

func (b Bytes) Get() []byte

func (Bytes) MarshalJSON

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

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(data []byte) (err error)

type Entity

type Entity struct {
	Data interface{}
}

func ByteEntity

func ByteEntity(b []byte) *Entity

func StringEntity

func StringEntity(s string) *Entity

func (*Entity) GetBytes

func (entity *Entity) GetBytes() (b []byte, err error)

func (*Entity) GetString

func (entity *Entity) GetString() (s string, err error)

func (Entity) MarshalJSON

func (entity Entity) MarshalJSON() ([]byte, error)

func (*Entity) Scan

func (v *Entity) Scan(src interface{}) error

func (*Entity) UnmarshalJSON

func (entity *Entity) UnmarshalJSON(data []byte) (err error)

func (Entity) Value

func (v Entity) Value() (driver.Value, error)

type Sec

type Sec time.Duration

func (Sec) Duration

func (t Sec) Duration() time.Duration

func (Sec) MarshalJSON

func (t Sec) MarshalJSON() ([]byte, error)

func (*Sec) UnmarshalJSON

func (t *Sec) UnmarshalJSON(s []byte) (err error)

type Unix

type Unix time.Time

func (Unix) MarshalJSON

func (t Unix) MarshalJSON() ([]byte, error)

func (Unix) Time

func (t Unix) Time() time.Time

func (*Unix) UnmarshalJSON

func (t *Unix) UnmarshalJSON(s []byte) (err error)

type UnixMilli

type UnixMilli time.Time

func (UnixMilli) DateTime

func (t UnixMilli) DateTime() time.Time

func (UnixMilli) MarshalBSONValue

func (t UnixMilli) MarshalBSONValue() (bsontype.Type, []byte, error)

func (UnixMilli) MarshalJSON

func (t UnixMilli) MarshalJSON() ([]byte, error)

func (UnixMilli) Time

func (t UnixMilli) Time() time.Time

func (*UnixMilli) UnmarshalBSONValue

func (t *UnixMilli) UnmarshalBSONValue(typ bsontype.Type, data []byte) (err error)

func (*UnixMilli) UnmarshalJSON

func (t *UnixMilli) UnmarshalJSON(s []byte) (err error)

func (UnixMilli) Value

func (t UnixMilli) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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