Documentation
¶
Index ¶
- Variables
- func FormatBracketStruct(typ *sppb.Type, toplevel bool, fieldStrings []string) string
- func FormatColumnLiteral(value spanner.GenericColumnValue) (string, error)
- func FormatColumnSpannerCLICompatible(value spanner.GenericColumnValue) (string, error)
- func FormatEnumAsCast(formatter Formatter, value spanner.GenericColumnValue, toplevel bool) (string, error)
- func FormatNullableSpannerCLICompatible(value NullableValue) (string, error)
- func FormatOptionallyTypedArray(typ *sppb.Type, toplevel bool, elemStrings []string) string
- func FormatProtoAsCast(formatter Formatter, value spanner.GenericColumnValue, toplevel bool) (string, error)
- func FormatRowLiteral(value *spanner.Row) ([]string, error)
- func FormatRowSpannerCLICompatible(row *spanner.Row) ([]string, error)
- func FormatSimpleStructField(fc *FormatConfig, field *sppb.StructType_Field, value *structpb.Value) (string, error)
- func FormatTupleStruct(typ *sppb.Type, toplevel bool, fieldStrings []string) string
- func FormatTypelessStructField(fc *FormatConfig, field *sppb.StructType_Field, value *structpb.Value) (string, error)
- func FormatUntypedArray(typ *sppb.Type, toplevel bool, elemStrings []string) string
- type FormatArrayFunc
- type FormatComplexFunc
- type FormatConfig
- type FormatNullableFunc
- type FormatStruct
- type FormatStructFieldFunc
- type FormatStructParenFunc
- type Formatter
- type NullBytes
- type NullableValue
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFallthrough = errors.New("fallthrough")
View Source
var FormatTypedStruct = FormatStruct{
FormatStructParen: formatTypedStructParen,
FormatStructField: formatSimpleStructField,
}
View Source
var LiteralFormatConfig = &FormatConfig{ NullString: nullStringUpperCase, FormatArray: FormatOptionallyTypedArray, FormatStruct: FormatTypedStruct, FormatNullable: formatNullableValueLiteral, FormatComplexPlugins: []FormatComplexFunc{ FormatProtoAsCast, FormatEnumAsCast, }, }
View Source
var SimpleFormatConfig = FormatConfig{ NullString: nullStringClientLib, FormatArray: FormatUntypedArray, FormatStruct: FormatStruct{ FormatStructField: FormatTypelessStructField, FormatStructParen: FormatTupleStruct, }, FormatNullable: formatNullableValueSimple, }
View Source
var SpannerCLICompatibleFormatConfig = FormatConfig{ NullString: nullStringUpperCase, FormatArray: FormatUntypedArray, FormatStruct: FormatStruct{ FormatStructField: FormatSimpleStructField, FormatStructParen: FormatBracketStruct, }, FormatNullable: FormatNullableSpannerCLICompatible, }
Functions ¶
func FormatBracketStruct ¶
func FormatColumnLiteral ¶
func FormatColumnLiteral(value spanner.GenericColumnValue) (string, error)
func FormatColumnSpannerCLICompatible ¶
func FormatColumnSpannerCLICompatible(value spanner.GenericColumnValue) (string, error)
func FormatEnumAsCast ¶
func FormatNullableSpannerCLICompatible ¶
func FormatNullableSpannerCLICompatible(value NullableValue) (string, error)
func FormatProtoAsCast ¶
func FormatSimpleStructField ¶
func FormatSimpleStructField(fc *FormatConfig, field *sppb.StructType_Field, value *structpb.Value) (string, error)
func FormatTupleStruct ¶
func FormatTypelessStructField ¶
func FormatTypelessStructField(fc *FormatConfig, field *sppb.StructType_Field, value *structpb.Value) (string, error)
Types ¶
type FormatArrayFunc ¶
type FormatComplexFunc ¶
type FormatComplexFunc = func(formatter Formatter, value spanner.GenericColumnValue, toplevel bool) (string, error)
FormatComplexFunc is a function to format spanner.GenericColumnValue. If it returns ErrFallthrough, value will pass through to next step.
type FormatConfig ¶
type FormatConfig struct {
NullString string
FormatArray FormatArrayFunc
FormatStruct FormatStruct
FormatComplexPlugins []FormatComplexFunc
FormatNullable FormatNullableFunc
}
func (*FormatConfig) FormatColumn ¶
func (fc *FormatConfig) FormatColumn(value spanner.GenericColumnValue, toplevel bool) (string, error)
func (*FormatConfig) FormatRow ¶
func (fc *FormatConfig) FormatRow(row *spanner.Row) ([]string, error)
func (*FormatConfig) FormatToplevelColumn ¶
func (fc *FormatConfig) FormatToplevelColumn(value spanner.GenericColumnValue) (string, error)
type FormatNullableFunc ¶
type FormatNullableFunc = func(value NullableValue) (string, error)
type FormatStruct ¶
type FormatStruct struct {
FormatStructField FormatStructFieldFunc
FormatStructParen FormatStructParenFunc
}
type FormatStructFieldFunc ¶
type FormatStructFieldFunc func(fc *FormatConfig, field *sppb.StructType_Field, value *structpb.Value) (string, error)
type FormatStructParenFunc ¶
type Formatter ¶
type Formatter interface {
FormatColumn(value spanner.GenericColumnValue, toplevel bool) (string, error)
}
type NullableValue ¶
type NullableValue interface {
spanner.NullableValue
fmt.Stringer
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.