inserter

package
Version: v0.0.0-...-766ad81 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0, MIT Imports: 2 Imported by: 3

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Remove

Remove any records for the network being inserted.

Types

type Func

type Func func(mmdbtype.DataType) (mmdbtype.DataType, error)

Func is a function that returns the data type to be inserted into an mmdbwriter.Tree using some conflict resolution strategy.

func DeepMergeWith

func DeepMergeWith(newValue mmdbtype.DataType) Func

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 ReplaceWith

func ReplaceWith(value mmdbtype.DataType) Func

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

func TopLevelMergeWith

func TopLevelMergeWith(newValue mmdbtype.DataType) Func

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.

type FuncGenerator

type FuncGenerator func(value mmdbtype.DataType) Func

FuncGenerator is a function that generates an Func given a value.

Source Files

Jump to

Keyboard shortcuts

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