fortigate

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse[T any] struct {
	HTTPStatus int    `json:"http_status"`
	Serial     string `json:"serial"`
	Version    string `json:"version"`
	Results    T      `json:"results"`
}

type DeviceResponse

type DeviceResponse struct {
	Hostname string `json:"hostname"`
}

type FortiClient

type FortiClient struct {
	HTTPClient *http.Client
	BaseURL    string
	APIToken   string
}

func NewAPIClient

func NewAPIClient(apiToken string, baseURL string, httpClient *http.Client) *FortiClient

func (FortiClient) MakeRequest

func (c FortiClient) MakeRequest(
	ctx context.Context,
	method, path string,
	body io.Reader,
) (*http.Response, error)

type FortiSystemInfo

type FortiSystemInfo struct {
	Hostname string
	Version  string
	Serial   string
}

type FortigateSource

type FortigateSource struct {
	common.Config
	// Fortinet data. Initialized in init functions.
	SystemInfo FortiSystemInfo              // Map storing system information
	Ifaces     map[string]InterfaceResponse // iface name -> FortigateInterface

	// NBFirewall representing fortinet firewall created in syncDevice func.
	NBFirewall *objects.Device
}

func (*FortigateSource) Init

func (fs *FortigateSource) Init() error

func (*FortigateSource) Sync

type InterfaceResponse

type InterfaceResponse struct {
	Name        string        `json:"name"`
	Vdom        string        `json:"vdom"`
	IP          string        `json:"Ip"`
	Type        string        `json:"type"`
	Status      string        `json:"status"`
	Speed       string        `json:"speed"`
	Description string        `json:"description"`
	MTU         int           `json:"mtu"`
	MAC         string        `json:"macaddr"`
	VlanID      int           `json:"vlanid"`
	SecondaryIP []SecondaryIP `json:"secondaryip"`
	VRRPIP      []VRRPIP      `json:"vrrp"`
}

type SecondaryIP

type SecondaryIP struct {
	IP string `json:"ip"`
}

type VRRPIP

type VRRPIP struct {
	VRIP string `json:"vrip"`
}

Jump to

Keyboard shortcuts

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