asset

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAssetNetworks

func GetAssetNetworks(ip string) []string

GetAssetNetworks return the CIDR network that the IP is in

func GetName

func GetName(ip string) string

GetName returns the asset name

func GetValue

func GetValue(ip string) int

GetValue returns asset value

func Init

func Init(confDir string) error

Init read assets from all asset_* files in confDir

func IsInHomeNet

func IsInHomeNet(ip string) (bool, error)

IsInHomeNet checks if IP is in HOME_NET

func IsWhiteListed added in v0.1.9

func IsWhiteListed(ip string) (bool, error)

IsWhiteListed checks if IP is whitelisted

Types

type NetworkAsset added in v0.4.1

type NetworkAsset struct {
	Name        string `json:"name"`
	Cidr        string `json:"cidr"`
	Value       int    `json:"value"`
	Whitelisted bool   `json:"whitelisted"`
}

NetworkAsset represents a single entry in assets_*.json config file

type NetworkAssets added in v0.4.1

type NetworkAssets struct {
	NetworkAssets []NetworkAsset `json:"assets"`
}

NetworkAssets represents collection of NetworkAsset

Jump to

Keyboard shortcuts

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