customtypes

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Overview

Package customtypes encapsulates our custom database field types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalNullString

func MarshalNullString(x NullString) graphql.Marshaler

MarshalNullString is used by graphql to marshal into a string

func MarshalNullTime

func MarshalNullTime(x NullTime) graphql.Marshaler

MarshalNullTime is used by GraphQL to marshal the value

Types

type NullString

type NullString struct {
	sql.NullString
}

NullString wrapper around sql.NullString

func UnmarshalNullString

func UnmarshalNullString(s interface{}) (NullString, error)

UnmarshalNullString is used by graphql to unmarshal from a NullString into a string

func (NullString) IsZero

func (x NullString) IsZero() bool

IsZero method is called by bson.IsZero in Mongo for type = NullTime

func (*NullString) MarshalBSONValue

func (x *NullString) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue method is called by bson.Marshal in Mongo for type = NullString

func (*NullString) MarshalJSON

func (x *NullString) MarshalJSON() ([]byte, error)

MarshalJSON method is called by the JSON marshaller

func (*NullString) UnmarshalBSONValue

func (x *NullString) UnmarshalBSONValue(t bsontype.Type, data []byte) error

UnmarshalBSONValue method is called by bson.Unmarshal in Mongo for type = NullString

func (*NullString) UnmarshalJSON

func (x *NullString) UnmarshalJSON(data []byte) error

UnmarshalJSON method is called by the JSON unmarshaller

type NullTime

type NullTime struct {
	sql.NullTime
}

NullTime wrapper around sql.NullTime

func UnmarshalNullTime

func UnmarshalNullTime(t interface{}) (NullTime, error)

UnmarshalNullTime is used by GraphQL to unmarshal the value

func (NullTime) IsZero

func (x NullTime) IsZero() bool

IsZero method is called by bson.IsZero in Mongo for type = NullTime

func (*NullTime) MarshalBSONValue

func (x *NullTime) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue method is called by bson.Marshal in Mongo for type = NullTime

func (*NullTime) MarshalJSON

func (x *NullTime) MarshalJSON() ([]byte, error)

MarshalJSON method is called by the JSON marshaller

func (*NullTime) UnmarshalBSONValue

func (x *NullTime) UnmarshalBSONValue(t bsontype.Type, data []byte) error

UnmarshalBSONValue method is called by bson.Unmarshal in Mongo for type = NullTime

func (*NullTime) UnmarshalJSON

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

UnmarshalJSON method is called by the JSON unmarshaller

Jump to

Keyboard shortcuts

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