dirty

package module
v0.0.0-...-58ce371 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: BSD-2-Clause Imports: 2 Imported by: 0

README

dirty

tracks when values have been unmarshalled

Documentation

Overview

Package dirty tracks when values have been unmarshalled in order to differentiate between values that are absent and values that are null.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	null.Bool
	Dirty bool
}

func BoolFrom

func BoolFrom(b bool) Bool

func (*Bool) Scan

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

func (*Bool) UnmarshalJSON

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

func (*Bool) UnmarshalText

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

type Float

type Float struct {
	null.Float
	Dirty bool
}

func FloatFrom

func FloatFrom(f float64) Float

func (*Float) Scan

func (f *Float) Scan(value interface{}) error

func (*Float) UnmarshalJSON

func (f *Float) UnmarshalJSON(data []byte) error

func (*Float) UnmarshalText

func (f *Float) UnmarshalText(text []byte) error

type Int

type Int struct {
	null.Int
	Dirty bool
}

func IntFrom

func IntFrom(i int64) Int

func (*Int) Scan

func (i *Int) Scan(value interface{}) error

func (*Int) UnmarshalJSON

func (i *Int) UnmarshalJSON(data []byte) error

func (*Int) UnmarshalText

func (i *Int) UnmarshalText(text []byte) error

type String

type String struct {
	null.String
	Dirty bool
}

func StringFrom

func StringFrom(s string) String

func (*String) Scan

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

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

func (*String) UnmarshalText

func (s *String) UnmarshalText(text []byte) error

type Time

type Time struct {
	null.Time
	Dirty bool
}

func TimeFrom

func TimeFrom(t time.Time) Time

func (*Time) Scan

func (t *Time) Scan(value interface{}) error

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(text []byte) error

type Update

type Update struct {
	From interface{} `json:"from"`
	To   interface{} `json:"to"`
}

type Updates

type Updates map[string]Update

func NewUpdates

func NewUpdates() Updates

func (Updates) DiffBool

func (u Updates) DiffBool(name string, field bool, value Bool) bool

func (Updates) DiffFloat

func (u Updates) DiffFloat(name string, field float64, value Float) float64

func (Updates) DiffInt

func (u Updates) DiffInt(name string, field int64, value Int) int64

func (Updates) DiffNullBool

func (u Updates) DiffNullBool(name string, field null.Bool, value Bool) null.Bool

func (Updates) DiffNullFloat

func (u Updates) DiffNullFloat(name string, field null.Float, value Float) null.Float

func (Updates) DiffNullInt

func (u Updates) DiffNullInt(name string, field null.Int, value Int) null.Int

func (Updates) DiffNullString

func (u Updates) DiffNullString(name string, field null.String, value String) null.String

func (Updates) DiffNullTime

func (u Updates) DiffNullTime(name string, field null.Time, value Time) null.Time

func (Updates) DiffNullTimeBool

func (u Updates) DiffNullTimeBool(name string, field null.Time, value Bool) null.Time

func (Updates) DiffString

func (u Updates) DiffString(name string, field string, value String) string

func (Updates) DiffTime

func (u Updates) DiffTime(name string, field time.Time, value Time) time.Time

Jump to

Keyboard shortcuts

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