object

package
v0.0.0-...-e749f68 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Type           AddressType     `json:"type"`
	Comment        string          `json:"comment,omitempty"`
	Host           *netip.Addr     `json:"host,omitempty"`
	Range          *netipx.IPRange `json:"range,omitempty"`
	NetworkAddress *netip.Prefix   `json:"network,omitempty"`
	Children       *[]string       `json:"children,omitempty"`
}

type AddressType

type AddressType int
const (
	Host AddressType = iota
	Range
	NetworkAddress
	AddressGroup
)

func (*AddressType) FromString

func (t *AddressType) FromString(input string) AddressType

func (AddressType) MarshalJSON

func (t AddressType) MarshalJSON() ([]byte, error)

func (AddressType) String

func (t AddressType) String() string

func (*AddressType) UnmarshalJSON

func (t *AddressType) UnmarshalJSON(b []byte) error

type Object

type Object struct {
	Addresses map[string]Address `json:"addresses"`
	Services  map[string]Service `json:"services"`
}

type Service

type Service struct {
	Type       ServiceType `json:"type"`
	Comment    string      `json:"comment,omitempty"`
	SPortStart *uint32     `json:"sport_start,omitempty"`
	SPortEnd   *uint32     `json:"sport_end,omitempty"`
	DPortStart *uint32     `json:"dport_start,omitempty"`
	DPortEnd   *uint32     `json:"dport_end,omitempty"`
	ICMPCode   *uint32     `json:"icmp_code,omitempty"`
	Children   *[]string   `json:"children,omitempty"`
}

func (Service) GetDPort

func (s Service) GetDPort() string

func (Service) GetSPort

func (s Service) GetSPort() string

type ServiceType

type ServiceType int
const (
	TCP ServiceType = iota
	UDP
	ICMP
	ServiceGroup
)

func (*ServiceType) FromString

func (t *ServiceType) FromString(input string) ServiceType

func (ServiceType) MarshalJSON

func (t ServiceType) MarshalJSON() ([]byte, error)

func (ServiceType) String

func (t ServiceType) String() string

func (*ServiceType) UnmarshalJSON

func (t *ServiceType) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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