data

package
v0.3.72 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SQLNullString added in v0.3.72

func SQLNullString(inp *string) sql.NullString

func SQLNullUUID added in v0.3.72

func SQLNullUUID(inp *uuid.UUID) uuid.NullUUID

Types

type Entity

type Entity struct {
	ID        string     `json:"id,omitempty"`
	CreatedAt time.Time  `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
}

type Model

type Model struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt NullTime  `json:"updated_at"`
	DeletedAt NullTime  `json:"deleted_at"`
}

func ModelFromEntity

func ModelFromEntity(e *Entity) Model

func (Model) Entity

func (m Model) Entity() Entity

type NullTime added in v0.3.72

type NullTime struct {
	sql.NullTime
}

func SQLNullTime added in v0.3.72

func SQLNullTime(inp *time.Time) NullTime

func (NullTime) MarshalJSON added in v0.3.72

func (nt NullTime) MarshalJSON() ([]byte, error)

func (*NullTime) UnmarshalJSON added in v0.3.72

func (nt *NullTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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