package types

Import Path
	github.com/go-pg/pg/v10/types (on go.dev)

Dependency Relation
	imports 22 packages, and imported by 2 packages


Package-Level Type Names (total 17, in which 14 are exported)
/* sort exporteds by: | */
func Appender(typ reflect.Type) AppenderFunc func ArrayAppender(typ reflect.Type) AppenderFunc func HstoreAppender(typ reflect.Type) AppenderFunc func RegisterAppender(value interface{}, fn AppenderFunc)
(*Array) AppendValue(b []byte, flags int) ([]byte, error) (*Array) ScanValue(rd Reader, n int) error (*Array) Value() interface{} *Array : ValueAppender *Array : ValueScanner func NewArray(vi interface{}) *Array func github.com/go-pg/pg/v10.Array(v interface{}) *Array
( ArrayValueScanner) AfterScanArrayValue() error ( ArrayValueScanner) BeforeScanArrayValue(rd Reader, n int) error ( ArrayValueScanner) ScanArrayValue(rd Reader, n int) error
(*HexEncoder) Bytes() []byte (*HexEncoder) Close() error (*HexEncoder) Write(b []byte) (int, error) *HexEncoder : io.Closer *HexEncoder : io.WriteCloser *HexEncoder : io.Writer func NewHexEncoder(b []byte, flags int) *HexEncoder
(*Hstore) AppendValue(b []byte, flags int) ([]byte, error) (*Hstore) ScanValue(rd Reader, n int) error (*Hstore) Value() interface{} *Hstore : ValueAppender *Hstore : ValueScanner func NewHstore(vi interface{}) *Hstore func github.com/go-pg/pg/v10.Hstore(v interface{}) *Hstore
Ident represents a SQL identifier, e.g. table or column name. ( Ident) AppendValue(b []byte, flags int) ([]byte, error) Ident : ValueAppender
NullTime is a time.Time wrapper that marshals zero time as JSON null and PostgreSQL NULL. Time time.Time Add returns the time t+d. AddDate returns the time corresponding to adding the given number of years, months, and days to t. For example, AddDate(-1, 2, 3) applied to January 1, 2011 returns March 4, 2010. AddDate normalizes its result in the same way that Date does, so, for example, adding one month to October 31 yields December 1, the normalized form for November 31. After reports whether the time instant t is after u. AppendFormat is like Format but appends the textual representation to b and returns the extended buffer. ( NullTime) AppendValue(b []byte, flags int) ([]byte, error) Before reports whether the time instant t is before u. Clock returns the hour, minute, and second within the day specified by t. Date returns the year, month, and day in which t occurs. Day returns the day of the month specified by t. Equal reports whether t and u represent the same time instant. Two times can be equal even if they are in different locations. For example, 6:00 +0200 and 4:00 UTC are Equal. See the documentation on the Time type for the pitfalls of using == with Time values; most code should use Equal instead. Format returns a textual representation of the time value formatted according to the layout defined by the argument. See the documentation for the constant called Layout to see how to represent the layout format. The executable example for Time.Format demonstrates the working of the layout string in detail and is a good reference. GoString implements fmt.GoStringer and formats t to be printed in Go source code. GobDecode implements the gob.GobDecoder interface. GobEncode implements the gob.GobEncoder interface. Hour returns the hour within the day specified by t, in the range [0, 23]. ISOWeek returns the ISO 8601 year and week number in which t occurs. Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1 of year n+1. In returns a copy of t representing the same time instant, but with the copy's location information set to loc for display purposes. In panics if loc is nil. IsDST reports whether the time in the configured location is in Daylight Savings Time. IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC. Local returns t with the location set to local time. Location returns the time zone information associated with t. MarshalBinary implements the encoding.BinaryMarshaler interface. ( NullTime) MarshalJSON() ([]byte, error) MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format, with sub-second precision added if present. Minute returns the minute offset within the hour specified by t, in the range [0, 59]. Month returns the month of the year specified by t. Nanosecond returns the nanosecond offset within the second specified by t, in the range [0, 999999999]. Round returns the result of rounding t to the nearest multiple of d (since the zero time). The rounding behavior for halfway values is to round up. If d <= 0, Round returns t stripped of any monotonic clock reading but otherwise unchanged. Round operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Round(Hour) may return a time with a non-zero minute, depending on the time's Location. (*NullTime) Scan(b interface{}) error Second returns the second offset within the minute specified by t, in the range [0, 59]. String returns the time formatted using the format string "2006-01-02 15:04:05.999999999 -0700 MST" If the time has a monotonic clock reading, the returned string includes a final field "m=±<value>", where value is the monotonic clock reading formatted as a decimal number of seconds. The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string. Sub returns the duration t-u. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, the maximum (or minimum) duration will be returned. To compute t-d for a duration d, use t.Add(-d). Truncate returns the result of rounding t down to a multiple of d (since the zero time). If d <= 0, Truncate returns t stripped of any monotonic clock reading but otherwise unchanged. Truncate operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Truncate(Hour) may return a time with a non-zero minute, depending on the time's Location. UTC returns t with the location set to UTC. Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t. Unix-like operating systems often record time as a 32-bit count of seconds, but since the method here returns a 64-bit value it is valid for billions of years into the past or future. UnixMicro returns t as a Unix time, the number of microseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in microseconds cannot be represented by an int64 (a date before year -290307 or after year 294246). The result does not depend on the location associated with t. UnixMilli returns t as a Unix time, the number of milliseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in milliseconds cannot be represented by an int64 (a date more than 292 million years before or after 1970). The result does not depend on the location associated with t. UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in nanoseconds cannot be represented by an int64 (a date before the year 1678 or after 2262). Note that this means the result of calling UnixNano on the zero Time is undefined. The result does not depend on the location associated with t. UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. (*NullTime) UnmarshalJSON(b []byte) error UnmarshalText implements the encoding.TextUnmarshaler interface. The time is expected to be in RFC 3339 format. Weekday returns the day of the week specified by t. Year returns the year in which t occurs. YearDay returns the day of the year specified by t, in the range [1,365] for non-leap years, and [1,366] in leap years. Zone computes the time zone in effect at time t, returning the abbreviated name of the zone (such as "CET") and its offset in seconds east of UTC. NullTime : ValueAppender *NullTime : database/sql.Scanner NullTime : encoding.BinaryMarshaler *NullTime : encoding.BinaryUnmarshaler NullTime : encoding.TextMarshaler *NullTime : encoding.TextUnmarshaler NullTime : encoding/json.Marshaler *NullTime : encoding/json.Unmarshaler NullTime : expvar.Var NullTime : fmt.GoStringer NullTime : fmt.Stringer
Type int32 Value string ( RawValue) AppendValue(b []byte, flags int) ([]byte, error) ( RawValue) MarshalJSON() ([]byte, error) RawValue : ValueAppender RawValue : encoding/json.Marshaler
type Reader = pool.Reader (interface)
Safe represents a safe SQL query. ( Safe) AppendValue(b []byte, flags int) ([]byte, error) Safe : ValueAppender func github.com/go-pg/pg/v10/orm.(*SafeQueryAppender).Value() Safe
func ArrayScanner(typ reflect.Type) ScannerFunc func HstoreScanner(typ reflect.Type) ScannerFunc func Scanner(typ reflect.Type) ScannerFunc func RegisterScanner(value interface{}, fn ScannerFunc)
( ValueAppender) AppendValue(b []byte, flags int) ([]byte, error) *Array *Hstore Ident NullTime RawValue Safe github.com/go-pg/pg/v10.Ints github.com/go-pg/pg/v10.Strings *github.com/go-pg/pg/v10/orm.SafeQueryAppender func In(slice interface{}) ValueAppender func InMulti(values ...interface{}) ValueAppender func github.com/go-pg/pg/v10.In(slice interface{}) ValueAppender func github.com/go-pg/pg/v10.InMulti(values ...interface{}) ValueAppender
( ValueScanner) ScanValue(rd Reader, n int) error *Array *Hstore
Package-Level Functions (total 121, in which 38 are exported)
func Append(b []byte, v interface{}, flags int) []byte
func AppendBytes(b []byte, bytes []byte, flags int) []byte
func AppendIdent(b []byte, field string, flags int) []byte
func AppendIdentBytes(b []byte, field []byte, flags int) []byte
func AppendJSONB(b, jsonb []byte, flags int) []byte
func AppendNull(b []byte, flags int) []byte
func AppendString(b []byte, s string, flags int) []byte
func AppendTime(b []byte, tm time.Time, flags int) []byte
func In(slice interface{}) ValueAppender
func InMulti(values ...interface{}) ValueAppender
func NewArray(vi interface{}) *Array
func NewHstore(vi interface{}) *Hstore
func ReadColumnValue(col ColumnInfo, rd Reader, n int) (interface{}, error)
RegisterAppender registers an appender func for the value type. Expecting to be used only during initialization, it panics if there is already a registered appender for the given type.
RegisterScanner registers an scanner func for the type. Expecting to be used only during initialization, it panics if there is already a registered scanner for the given type.
func Scan(v interface{}, rd Reader, n int) error
Package-Level Constants (total 27, none are exported)