给定一组IP地址范围,其中包含给定IP地址的所有范围

I have a set of IP address ranges, which correspond to some conditions.

Given an input IP address, I want to know all the sets of the IP ranges which contain this input IP address.

So far a segment tree seems to be suitable https://github.com/toberndo/go-stree but it takes only integers whereas I need IPv4 and IPv6 ranges.

Any suggestions on the algorithm suitable for this kind of a problem? Maybe an extension to Go/GoLang check IP address in range