util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAbsolutePath

func IsAbsolutePath(path string) bool

IsAbsolutePath checks if a path is an absolute Firestore path

func IsRelativePath

func IsRelativePath(path string) bool

IsRelativePath checks if a path is a relative Firestore path

func JSONToFirestoreValue

func JSONToFirestoreValue(value any, client *firestore.Client) (any, 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

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

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

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