Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoolMarshaller ¶
type BoolMarshaller struct {
*wrapperspb.BoolValue
}
BoolMarshaller marshals a wrapped *wrapperspb.BoolValue value, inserting null if the pointer is null, or the inner value if it is not.
func Bool ¶ added in v0.2.1
func Bool(wrapper *wrapperspb.BoolValue) BoolMarshaller
Bool returns a BoolMarshaller with an inner value set to wrapper.
func (*BoolMarshaller) Scan ¶
func (value *BoolMarshaller) Scan(src interface{}) error
Scan converts a value from the database.
type BytesMarshaller ¶
type BytesMarshaller struct {
*wrapperspb.BytesValue
}
BytesMarshaller marshals a wrapped *wrapperspb.BytesValue value, inserting null if the pointer is null, or the inner value if it is not.
func Bytes ¶ added in v0.2.1
func Bytes(wrapper *wrapperspb.BytesValue) BytesMarshaller
Bytes returns a BytesMarshaller with an inner value set to wrapper.
func (*BytesMarshaller) Scan ¶
func (value *BytesMarshaller) Scan(src interface{}) error
Scan converts a value from the database.
type DoubleMarshaller ¶
type DoubleMarshaller struct {
*wrapperspb.DoubleValue
}
DoubleMarshaller marshals a wrapped *wrapperspb.DoubleValue value, inserting null if the pointer is null, or the inner value if it is not.
func Double ¶ added in v0.2.1
func Double(wrapper *wrapperspb.DoubleValue) DoubleMarshaller
Double returns a DoubleMarshaller with an inner value set to wrapper.
func (*DoubleMarshaller) Scan ¶
func (value *DoubleMarshaller) Scan(src interface{}) error
Scan converts a value from the database.
type EnumStringMarshaller ¶
type EnumStringMarshaller struct { // Enum is the value to encode as a string when marshalling. // // When unmarshalling, this field must contain a value of the desired Enum type // to receive. Enum protoEnum }
EnumStringMarshaller marshals and unmarshalls a string for sql db values.
func Enum ¶
func Enum(enumVal protoEnum) *EnumStringMarshaller
Enum creates a new EnumStringMarshaller for marshalling or unmarshalling protobuf enums to and from strings.
To unmarshal an enum, a concrete value of the TYPE of enum you are expecting must be provided. This inner value will be nilled if the db passed back a null value.
When marshalling, if enumVal is nil, a NULL value will be added to the database.
func (*EnumStringMarshaller) Scan ¶
func (enum *EnumStringMarshaller) Scan(src interface{}) error
Scan received a string value from the database and transforms it into a new value.
type FloatMarshaller ¶
type FloatMarshaller struct {
*wrapperspb.FloatValue
}
FloatMarshaller marshals a wrapped *wrapperspb.FloatValue value, inserting null if the pointer is null, or the inner value if it is not.
func Float ¶ added in v0.2.1
func Float(wrapper *wrapperspb.FloatValue) FloatMarshaller
Float returns a FloatMarshaller with an inner value set to wrapper.
func (*FloatMarshaller) Scan ¶
func (value *FloatMarshaller) Scan(src interface{}) error
Scan converts a value from the database.
type Int32Marshaller ¶
type Int32Marshaller struct {
*wrapperspb.Int32Value
}
Int32Marshaller marshals a wrapped *wrapperspb.Int32Value value, inserting null if the pointer is null, or the inner value if it is not.
func Int32 ¶ added in v0.2.1
func Int32(wrapper *wrapperspb.Int32Value) Int32Marshaller
Int32 returns a Int32Marshaller with an inner value set to wrapper.
func (*Int32Marshaller) Scan ¶
func (value *Int32Marshaller) Scan(src interface{}) error
Scan converts a value from the database.
type Int64Marshaller ¶
type Int64Marshaller struct {
*wrapperspb.Int64Value
}
Int64Marshaller marshals a wrapped *wrapperspb.Int64Value value, inserting null if the pointer is null, or the inner value if it is not.
func Int64 ¶ added in v0.2.1
func Int64(wrapper *wrapperspb.Int64Value) Int64Marshaller
Int64 returns a Int64Marshaller with an inner value set to wrapper.
func (*Int64Marshaller) Scan ¶
func (value *Int64Marshaller) Scan(src interface{}) error
Scan converts a value from the database.
type MessageBlobMarshaller ¶ added in v0.2.2
MessageBlobMarshaller marshals a proto message to a blob and back for storing protobufs directly to a blob field.
func Message ¶ added in v0.2.2
func Message(message proto.Message) *MessageBlobMarshaller
Message creates a new MessageBlobMarshaller for storing / reading an entire protobuf message to / from a blob field.
func (*MessageBlobMarshaller) Scan ¶ added in v0.2.2
func (message *MessageBlobMarshaller) Scan(src interface{}) error
Scan converts the value from time.Time for the sql driver to handle.
type StringMarshaller ¶
type StringMarshaller struct {
*wrapperspb.StringValue
}
StringMarshaller marshals a wrapped *wrapperspb.StringValue value, inserting null if the pointer is null, or the inner value if it is not.
func String ¶ added in v0.2.1
func String(wrapper *wrapperspb.StringValue) StringMarshaller
String returns a StringMarshaller with an inner value set to wrapper.
func (*StringMarshaller) Scan ¶
func (value *StringMarshaller) Scan(src interface{}) error
Scan converts a value from the database.
type TimestampMarshaller ¶
type TimestampMarshaller struct {
*timestamppb.Timestamp
}
TimestampMarshaller wraps a *timestamppb.Timestamp value for marshalling to an SQL database.
func Timestamp ¶ added in v0.2.1
func Timestamp(value *timestamppb.Timestamp) TimestampMarshaller
Timestamp creates a new TimestampMarshaller for a given value
func (*TimestampMarshaller) Scan ¶
func (timestamp *TimestampMarshaller) Scan(src interface{}) error
Scan converts the value from time.Time for the sql driver to handle.
type UInt32Marshaller ¶
type UInt32Marshaller struct {
*wrapperspb.UInt32Value
}
UInt32Marshaller marshals a wrapped *wrapperspb.UInt32Value value, inserting null if the pointer is null, or the inner value if it is not.
func UInt32 ¶ added in v0.2.1
func UInt32(wrapper *wrapperspb.UInt32Value) UInt32Marshaller
UInt32 returns a UInt32Marshaller with an inner value set to wrapper.
func (*UInt32Marshaller) Scan ¶
func (value *UInt32Marshaller) Scan(src interface{}) error
Scan converts a value from the database.
type UInt64Marshaller ¶
type UInt64Marshaller struct {
*wrapperspb.UInt64Value
}
UInt64Marshaller marshals a wrapped *wrapperspb.UInt64Value value, inserting null if the pointer is null, or the inner value if it is not.
func UInt64 ¶ added in v0.2.1
func UInt64(wrapper *wrapperspb.UInt64Value) UInt64Marshaller
UInt64 returns a UInt64Marshaller with an inner value set to wrapper.
func (*UInt64Marshaller) Scan ¶
func (value *UInt64Marshaller) Scan(src interface{}) error
Scan converts a value from the database.
type UUIDHexMarshaller ¶
UUIDHexMarshaller wraps *cereal.UUID and marshals to a hex-string format.
func UUIDHex ¶ added in v0.2.1
func UUIDHex(uuid *cereal.UUID) UUIDHexMarshaller
UUIDHex creates a new hex string marshaller for cereal.UUID values.
func (*UUIDHexMarshaller) Scan ¶
func (uuid *UUIDHexMarshaller) Scan(src interface{}) error