jsonbq

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeRepeated string = "REPEATED"
	ModeRequired string = "REQUIRED"
	ModeNullable string = "NULLABLE"
)

Different modes of a BigQuery field.

Variables

This section is empty.

Functions

func MarshalSchema

func MarshalSchema(schema bigquery.Schema) ([]byte, error)

MarshalSchema marshals a BigQuery schema to a valid BigQuery JSON schema based on default MarshalOptions. The JSON conforms to the format in this example: https://cloud.google.com/bigquery/docs/nested-repeated#example_schema

Types

type Field

type Field struct {
	Name        string             `json:"name"`
	Type        bigquery.FieldType `json:"type"`
	Mode        string             `json:"mode"`
	Description string             `json:"description,omitempty"`
	Fields      []*Field           `json:"fields,omitempty"`
}

Field describes the schema of a field in BigQuery.

type MarshalOptions added in v0.18.0

type MarshalOptions struct {
	// Indent specifies the set of indentation characters to use in a formatted
	// output such that every entry is preceded by Indent and terminated by a newline.
	// Leave Indent empty to disable formatted output.
	Indent string
}

MarshalOptions is a configurable BigQuery schema json marshaller.

func (MarshalOptions) MarshalSchema added in v0.18.0

func (o MarshalOptions) MarshalSchema(schema bigquery.Schema) ([]byte, error)

MarshalSchema marshals a BigQuery schema to a valid BigQuery JSON schema based on the given MarshalOptions. The JSON conforms to the format in this example: https://cloud.google.com/bigquery/docs/nested-repeated#example_schema

Jump to

Keyboard shortcuts

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