Documentation ¶
Overview ¶
Package msort contains utility functions for sorting and de-duplicating batches of mutations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UniqueByKey ¶
UniqueByKey implements a "last one wins" approach to removing mutations with duplicate keys from the input slice. If two mutations share the same Key, then the one with the later Time is returned. If there are mutations with identical Keys and Times, exactly one of the values will be chosen arbitrarily.
A new slice is returned.
This function will panic if any of the mutation Key fields are entirely empty. An empty json array (i.e. `[]`) is acceptable.
func UniqueByTimeKey ¶
UniqueByTimeKey implements a "last one wins" approach to removing mutations with duplicate (time, key) tuples from the input slice. If two mutations share the same (time, key) pair, then the one later in the input slice is returned.
A new slice is returned.
This function will panic if any of the mutation Key fields are entirely empty. An empty json array (i.e. `[]`) is acceptable.
Types ¶
This section is empty.