Package inserter provides some common inserter functions for mmdbwriter.InsertFunc.



This section is empty.


This section is empty.


func DeepMergeWith

func DeepMergeWith(newValue mmdbtype.DataType) func(mmdbtype.DataType) (mmdbtype.DataType, error)

DeepMergeWith creates an inserter that will recursively update an existing value. Map and Slice values will be merged recursively. Other values will be replaced by the new value.

func Remove

func Remove(value mmdbtype.DataType) (mmdbtype.DataType, error)

Remove any records for the network being inserted.

func ReplaceWith

func ReplaceWith(value mmdbtype.DataType) func(mmdbtype.DataType) (mmdbtype.DataType, error)

ReplaceWith generates an inserter function that replaces the existing value with the new value.

func TopLevelMergeWith

func TopLevelMergeWith(newValue mmdbtype.DataType) func(mmdbtype.DataType) (mmdbtype.DataType, error)

TopLevelMergeWith creates an inserter for Map values that will update an existing Map by adding the top-level keys and values from the new Map, replacing any existing values for the keys.

Both the new and existing value must be a Map. An error will be returned otherwise.


This section is empty.

Source Files