spannertag

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package spannertag exports the Cloud Spanner Go client library's `spanner` struct tag parser for use with the fields cache, so third-party libraries can list struct fields with the exact semantics of cloud.google.com/go/spanner.Row.ToStruct and the *Struct mutation constructors.

Index

Constants

This section is empty.

Variables

Cache is a shared fields.Cache built on Parser, the exported counterpart of the client's fieldCache.

Functions

func Parser

func Parser(t reflect.StructTag) (name string, keep bool, other interface{}, err error)

Parser parses the `spanner` struct tag: `spanner:"-"` drops the field; `spanner:"->"` marks it read-only keeping the Go field name; otherwise the tag splits on ";" with the column name first and `->` or case-insensitive `readonly` parts marking the field read-only. It satisfies the parseTag contract of fields.NewCache.

Types

type Tag

type Tag struct {
	// ReadOnly is true if the field should be excluded from writes (read-only).
	ReadOnly bool
}

Tag contains metadata about a struct field's spanner tag. It is stored as the parsed-tag value of each fields.Field listed through Cache or any cache built on Parser.

Jump to

Keyboard shortcuts

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