partitionkey

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate added in v1.10.0

func Validate(template string) error

Validate checks a template on create and update: it must parse and be one of the accepted forms. An empty template is valid.

Types

type Template added in v1.10.0

type Template struct {
	// contains filtered or unexported fields
}

Template is a partition key template, compiled once.

func New added in v1.10.0

func New(template string) (*Template, error)

New compiles the template of a stored destination. A template that does not parse is not an error: it yields the fallback key, as it always has. A template that parses but is not an accepted form is an error and is never evaluated.

func (*Template) Evaluate added in v1.10.0

func (t *Template) Evaluate(payload map[string]interface{}, fallbackKey string) (string, error)

Evaluate extracts a partition key from payload. If there is no template or evaluation returns nil/empty, fallbackKey is returned.

Jump to

Keyboard shortcuts

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