opnsense

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

README

opnsense-go

Go library for the OPNsense API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Controllers
	Routes     *routes
	Interfaces *interfaces
	Unbound    *unbound
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options Options) *Client

func (*Client) ReconfigureService

func (c *Client) ReconfigureService(ctx context.Context, endpoint string) error

ReconfigureService defined at the endpoint.

type InterfacesVlan

type InterfacesVlan struct {
	Description string      `json:"descr"`
	Tag         string      `json:"tag"`
	Priority    SelectedMap `json:"pcp"`
	Parent      SelectedMap `json:"if"`
	Device      string      `json:"vlanif"`
}

type Options

type Options struct {
	Uri           string
	APIKey        string
	APISecret     string
	AllowInsecure bool

	// Retries
	MaxBackoff int64
	MinBackoff int64
	MaxRetries int64
}

type Route

type Route struct {
	Disabled    string      `json:"disabled"`
	Description string      `json:"descr"`
	Gateway     SelectedMap `json:"gateway"`
	Network     string      `json:"network"`
}

type SelectedMap

type SelectedMap string

func (*SelectedMap) String

func (s *SelectedMap) String() string

func (*SelectedMap) UnmarshalJSON

func (s *SelectedMap) UnmarshalJSON(data []byte) error

type UnboundDomainOverride

type UnboundDomainOverride struct {
	Enabled     string `json:"enabled"`
	Domain      string `json:"domain"`
	Server      string `json:"server"`
	Description string `json:"description"`
}

type UnboundForward

type UnboundForward struct {
	Enabled  string      `json:"enabled"`
	Domain   string      `json:"domain"`
	Type     SelectedMap `json:"type"`
	Server   string      `json:"server"`
	Port     string      `json:"port"`
	VerifyCN string      `json:"verify"`
}

type UnboundHostAlias

type UnboundHostAlias struct {
	Enabled     string      `json:"enabled"`
	Host        SelectedMap `json:"host"`
	Hostname    string      `json:"hostname"`
	Domain      string      `json:"domain"`
	Description string      `json:"description"`
}

type UnboundHostOverride

type UnboundHostOverride struct {
	Enabled     string      `json:"enabled"`
	Hostname    string      `json:"hostname"`
	Domain      string      `json:"domain"`
	Type        SelectedMap `json:"rr"`
	Server      string      `json:"server"`
	MXPriority  string      `json:"mxprio"`
	MXDomain    string      `json:"mx"`
	Description string      `json:"description"`
}

Jump to

Keyboard shortcuts

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