Documentation ¶
Index ¶
- func GetDefaultPhantomSubnets() *pb.PhantomSubnetsList
- func GetUnweightedSubnetList(subnetsList *pb.PhantomSubnetsList) ([]*phantomNet, error)
- func V4Only(obj []*phantomNet) ([]*phantomNet, error)
- func V6Only(obj []*phantomNet) ([]*phantomNet, error)
- type PhantomIP
- func SelectAddrFromSubnetOffset(net1 *phantomNet, offset *big.Int) (*PhantomIP, error)
- func SelectPhantom(seed []byte, subnetsList *pb.PhantomSubnetsList, transform SubnetFilter, ...) (*PhantomIP, error)
- func SelectPhantomUnweighted(seed []byte, subnets *pb.PhantomSubnetsList, transform SubnetFilter) (*PhantomIP, error)
- func SelectPhantomWeighted(seed []byte, subnets *pb.PhantomSubnetsList, transform SubnetFilter) (*PhantomIP, error)
- type SubnetFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultPhantomSubnets ¶
func GetDefaultPhantomSubnets() *pb.PhantomSubnetsList
GetDefaultPhantomSubnets implements the
func GetUnweightedSubnetList ¶
func GetUnweightedSubnetList(subnetsList *pb.PhantomSubnetsList) ([]*phantomNet, error)
GetUnweightedSubnetList returns the list of subnets provided by the protobuf. Convenience function to not have to export getSubnets() or parseSubnets()
Types ¶
type PhantomIP ¶ added in v0.6.5
type PhantomIP struct {
// contains filtered or unexported fields
}
func SelectAddrFromSubnetOffset ¶
SelectAddrFromSubnetOffset given a CIDR block and offset, return the net.IP
func SelectPhantom ¶
func SelectPhantom(seed []byte, subnetsList *pb.PhantomSubnetsList, transform SubnetFilter, weighted bool) (*PhantomIP, error)
SelectPhantom - select one phantom IP address based on shared secret
func SelectPhantomUnweighted ¶
func SelectPhantomUnweighted(seed []byte, subnets *pb.PhantomSubnetsList, transform SubnetFilter) (*PhantomIP, error)
SelectPhantomUnweighted - select one phantom IP address based on shared secret
func SelectPhantomWeighted ¶
func SelectPhantomWeighted(seed []byte, subnets *pb.PhantomSubnetsList, transform SubnetFilter) (*PhantomIP, error)
SelectPhantomWeighted - select one phantom IP address based on shared secret
func (*PhantomIP) SupportRandomPort ¶ added in v0.6.5
type SubnetFilter ¶
type SubnetFilter func([]*phantomNet) ([]*phantomNet, error)
SubnetFilter - Filter IP subnets based on whatever to prevent specific subnets from
inclusion in choice. See v4Only and v6Only for reference.
Click to show internal directories.
Click to hide internal directories.