data

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 10 Imported by: 0

README

github.com/zengabor/data

Data-related functions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatastoreKeyFromString added in v1.2.0

func DatastoreKeyFromString(s string) *datastore.Key

func DatastoreKeyToString added in v1.2.0

func DatastoreKeyToString(k *datastore.Key) string

func EmailAddressToName

func EmailAddressToName(emailAddress string) string

func NewULID

func NewULID() string

func NewUUID4Str

func NewUUID4Str() string

func Now

func Now() time.Time

UTC Now, rounded to microseconds (for datastore)

func NowSeconds

func NowSeconds() time.Time

Types

type ChangeAwareCopier

type ChangeAwareCopier bool

Copies values, and sets flag if there was a change in the destination

func (*ChangeAwareCopier) CopyBool

func (c *ChangeAwareCopier) CopyBool(src bool, dst *bool)

func (*ChangeAwareCopier) CopyInt

func (c *ChangeAwareCopier) CopyInt(src int, dst *int)

func (*ChangeAwareCopier) CopyNilBool

func (c *ChangeAwareCopier) CopyNilBool(src NilBool, dst *NilBool)

func (*ChangeAwareCopier) CopyString

func (c *ChangeAwareCopier) CopyString(src string, dst *string)

func (*ChangeAwareCopier) CopyStringIfAny

func (c *ChangeAwareCopier) CopyStringIfAny(src string, dst *string)

func (*ChangeAwareCopier) CopyStringIfMissing

func (c *ChangeAwareCopier) CopyStringIfMissing(src string, dst *string)

func (*ChangeAwareCopier) CopyStringWithWarning

func (c *ChangeAwareCopier) CopyStringWithWarning(src string, dst *string, fieldName string) string

func (*ChangeAwareCopier) CopyTime

func (c *ChangeAwareCopier) CopyTime(src time.Time, dst *time.Time)

func (*ChangeAwareCopier) DestinationUpdated

func (c *ChangeAwareCopier) DestinationUpdated() bool

type DiffAwareCopier

type DiffAwareCopier bool

Copies values and sets flag if destination differs from source

func (*DiffAwareCopier) CopyStringIfMissing

func (d *DiffAwareCopier) CopyStringIfMissing(src string, dst *string)

func (*DiffAwareCopier) Different

func (d *DiffAwareCopier) Different() bool

type NilBool

type NilBool int32
const (
	NilBoolUnset NilBool = 0
	NilBoolTrue  NilBool = 1
	NilBoolFalse NilBool = -1
)

func NilBoolFromBool

func NilBoolFromBool(value bool) NilBool

func NilBoolFromString

func NilBoolFromString(value string) NilBool

func (NilBool) IsFalse

func (nb NilBool) IsFalse() bool

func (NilBool) IsSet

func (nb NilBool) IsSet() bool

func (NilBool) IsTrue

func (nb NilBool) IsTrue() bool

func (NilBool) Set

func (nb NilBool) Set(value bool)

func (NilBool) Unset

func (nb NilBool) Unset()

type UUID

type UUID []byte

func NewUUID4

func NewUUID4() UUID

func (UUID) String

func (u UUID) String() string

func (UUID) URLSafe

func (u UUID) URLSafe() string

Jump to

Keyboard shortcuts

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