{"modulePath":"github.com/reactima/nullable","version":"v0.0.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package nullable\n\n## Functions\n\n```go\nfunc SqlPrepare(x interface{}) interface{}\n```\nTODO add sanitizing function to make it even more safer see [https://github.com/jackc/pgx](https://github.com/jackc/pgx)\n\n## Types\n\n```go\ntype JSONText json.RawMessage\n```\nJSONText is a json.RawMessage, which is a \\[]byte underneath. Value() validates the json format in the source, and returns an error if the json is not valid.  Scan does no validation.  JSONText additionally implements \\`Unmarshal\\`, which unmarshals the json within to an interface{}\n\n```go\nfunc (j JSONText) MarshalJSON() ([]byte, error)\n```\nMarshalJSON returns the \\*j as the JSON encoding of j.\n\n```go\nfunc (j *JSONText) Scan(src interface{}) error\n```\nScan stores the src in \\*j.  No validation is done.\n\n```go\nfunc (j JSONText) String() string\n```\nString supports pretty printing for JSONText types.\n\n```go\nfunc (j *JSONText) Unmarshal(v interface{}) error\n```\nUnmarshal unmarshal's the json in j to v, as in json.Unmarshal.\n\n```go\nfunc (j *JSONText) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON sets \\*j to a copy of data\n\n```go\nfunc (j JSONText) Value() (driver.Value, error)\n```\nValue returns j as a value.  This does a validating unmarshal into another RawMessage.  If j is invalid json, it returns an error.\n\n```go\ntype NullBool sql.NullBool\n```\nNullBool is an alias for sql.NullBool data type\n\n```go\nfunc SetBool(b bool) *NullBool\n```\n\n```go\nfunc (ns NullBool) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (nb *NullBool) Scan(value interface{}) error\n```\nScan implements the Scanner interface for NullBool\n\n```go\nfunc (ns *NullBool) UnmarshalJSON(b []byte) error\n```\n\n```go\nfunc (n *NullBool) Value() (driver.Value, error)\n```\n\n```go\ntype NullBoolString struct {\n\tString string\n\tValid  bool\n}\n```\nTODO depricate\n\n```go\nfunc SetStrBool(s string) *NullBoolString\n```\n\n```go\nfunc (ns NullBoolString) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (ns *NullBoolString) Scan(value interface{}) error\n```\n\n```go\nfunc (ns *NullBoolString) UnmarshalJSON(b []byte) error\n```\n\n```go\nfunc (ns NullBoolString) Value() (driver.Value, error)\n```\n\n```go\ntype NullFloat64 struct {\n\tFloat64 float64\n\tValid   bool\n}\n```\n\n```go\nfunc (ns NullFloat64) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (n *NullFloat64) Scan(value interface{}) error\n```\n\n```go\nfunc (n NullFloat64) Value() (driver.Value, error)\n```\n\n```go\ntype NullInt64 struct {\n\tInt64 int64\n\tValid bool\n}\n```\nNullInt64 can accept string or interger from UnmarshalJSON\n\n```go\nfunc SetInt64(i int64) *NullInt64\n```\n\n```go\nfunc SetInt64FromStr(s string) *NullInt64\n```\n\n```go\nfunc (n NullInt64) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (n *NullInt64) Scan(value interface{}) error\n```\n\n```go\nfunc (n *NullInt64) UnmarshalJSON(b []byte) error\n```\n\n```go\nfunc (n NullInt64) Value() (driver.Value, error)\n```\n\n```go\ntype NullJSONText struct {\n\tJSONText\n\tValid bool // Valid is true if JSONText is not NULL\n}\n```\nNullJSONText represents a JSONText that may be null. NullJSONText implements the scanner interface so it can be used as a scan destination, similar to NullString.\n\n```go\nfunc SetEmptyJson() (*NullJSONText, error)\n```\n\n```go\nfunc (n *NullJSONText) Scan(value interface{}) error\n```\nScan implements the Scanner interface.\n\n```go\nfunc (n NullJSONText) Value() (driver.Value, error)\n```\nValue implements the driver Valuer interface.\n\n```go\ntype NullString struct {\n\tString string\n\tValid  bool\n}\n```\nNullString MarshalJSON ignores \"\"\n\n```go\nfunc SetStr(s string) *NullString\n```\n\n```go\nfunc SetStrFromInt64(i int64) *NullString\n```\n\n```go\nfunc (ns NullString) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (ns *NullString) Scan(value interface{}) error\n```\n\n```go\nfunc (ns *NullString) UnmarshalJSON(b []byte) error\n```\n\n```go\nfunc (ns NullString) Value() (driver.Value, error)\n```\n\n```go\ntype NullTime struct {\n\tTime  time.Time\n\tValid bool\n}\n```\nNullTime MarshalJSON ignores ZeroTime\n\n```go\nfunc SetDateStrTime(s string) *NullTime\n```\n\n```go\nfunc SetNow() *NullTime\n```\n\n```go\nfunc (ns NullTime) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (nt *NullTime) Scan(value interface{}) error\n```\n\n```go\nfunc (ns *NullTime) UnmarshalJSON(b []byte) error\n```\n\n```go\nfunc (nt NullTime) Value() (driver.Value, error)\n```\n\n","path":"github.com/reactima/nullable","name":"nullable","synopsis":"","isRedistributable":true}
