types

package
v0.0.0-...-8fd811e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONString

type JSONString string

JSONString is a string containing JSON encoded data, it prevents further json encoding when used inside a struct that gets encoded cant' use json.RawMessage because of:sql: Scan error on column index 1, name "processes": unsupported Scan, storing driver.Value type string into type *json.RawMessage

func (JSONString) MarshalJSON

func (js JSONString) MarshalJSON() ([]byte, error)

func (*JSONString) UnmarshalJSON

func (js *JSONString) UnmarshalJSON(data []byte) error

type StringSlice

type StringSlice []string

StringSlice is used for storing string slice in sqlite

func (*StringSlice) Scan

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

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

type TimeJSON

type TimeJSON struct {
	time.Time
}

TimeJSON is a wrapped time value that will marshal and unmarshal zero time to JSON as an empty string

func EmptyTimeJSON

func EmptyTimeJSON() (nilTime TimeJSON)

func NewTimeJSON

func NewTimeJSON(t time.Time) (nilTime TimeJSON)

func (*TimeJSON) MarshalJSON

func (et *TimeJSON) MarshalJSON() ([]byte, error)

func (*TimeJSON) ToTime

func (et *TimeJSON) ToTime() (t time.Time)

func (*TimeJSON) UnmarshalJSON

func (et *TimeJSON) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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