mutations

package
v0.0.0-...-4dcfcdd Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mutations contains a helper to generate mutations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(a types.Mutation, b types.Mutation) bool

Equal compares mutations, but treats a nil slice and a slice containing "null" as equivalent.

func Generator

func Generator(ctx context.Context, idCount int, deleteFraction float32) <-chan types.Mutation

Generator returns a channel from which an infinite number of mutations can be read. The total number of distinct payload PK value is controlled with the idCount argument. The mutations will have Payload instances encoded into their Data or Key fields, based on the deleteFraction value.

func IsNullish

func IsNullish(raw json.RawMessage) bool

IsNullish returns true if the message is empty or contains the JSON null token.

Types

type Payload

type Payload struct {
	PK  uuid.UUID `json:"pk"`
	Ver int       `json:"ver"`
	TS  time.Time `json:"ts"`
}

Payload instances are generated by a Generator.

Jump to

Keyboard shortcuts

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