util

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirestoreValueToJSON

func FirestoreValueToJSON(value interface{}) interface{}

FirestoreValueToJSON converts a Firestore value to a simplified JSON representation This removes type information and returns plain values

func IsAbsolutePath added in v0.14.0

func IsAbsolutePath(path string) bool

IsAbsolutePath checks if a path is an absolute Firestore path

func IsRelativePath added in v0.14.0

func IsRelativePath(path string) bool

IsRelativePath checks if a path is a relative Firestore path

func JSONToFirestoreValue

func JSONToFirestoreValue(value interface{}, client *firestore.Client) (interface{}, error)

JSONToFirestoreValue converts a JSON value with type information to a Firestore-compatible value The input should be a map with a single key indicating the type (e.g., "stringValue", "integerValue") If a client is provided, referenceValue types will be converted to *firestore.DocumentRef

func ValidateCollectionPath added in v0.14.0

func ValidateCollectionPath(path string) error

ValidateCollectionPath validates that a path is a valid Firestore collection path. Collection paths must have an odd number of segments (collection/doc/collection)

func ValidateDocumentPath added in v0.14.0

func ValidateDocumentPath(path string) error

ValidateDocumentPath validates that a path is a valid Firestore document path. Document paths must have an even number of segments (collection/doc or collection/doc/collection/doc)

Types

type PathType added in v0.14.0

type PathType int

PathType represents the type of Firestore path

const (
	CollectionPath PathType = iota
	DocumentPath
)

Jump to

Keyboard shortcuts

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