Back to

Package inserter

Latest Go to latest

The latest major version is .

Published: Oct 6, 2020 | Licenses: Apache-2.0 , MIT | Module:


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


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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier