mikrotik

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package mikrotik contains specific for RouterOS structs and functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSStaticEntries

type DNSStaticEntries []DNSStaticEntry

DNSStaticEntries is static DNS entries set.

func (DNSStaticEntries) Render

func (se DNSStaticEntries) Render(to io.Writer, opts ...RenderingOptions) (int, error)

Render mikrotik static dns entry and write it into some writer. Returned values is count of wrote bytes and error, if something goes wrong.

type DNSStaticEntry

type DNSStaticEntry struct {
	Address  string // IP address (net.IP is not used for allocation avoiding reasons (to string), eg.: 0.0.0.0)
	Comment  string // Short description of the item (eg.: Any text)
	Disabled bool   // Defines whether item is ignored or used (eg.: yes,no)
	Name     string // Host name (eg.: www.example.com)
	Regexp   string // Regular expression (eg.: .*\\.example\\.com)
	TTL      string // Time To Live (eg.: 1d)
}

DNSStaticEntry is static DNS entry for RouterOS usage.

func (*DNSStaticEntry) Format

func (s *DNSStaticEntry) Format(prefix, postfix string) ([]byte, error)

Format entry as a text in RouterOS script format. Important: keep im mind that any unexpected characters will be formatted as-is (without escaping or filtering).

type Error

type Error uint8

Error is a special type for package-specific errors.

const ErrEmptyFields Error = 1

ErrEmptyFields means required fields does not filled.

func (Error) Error

func (err Error) Error() string

Error returns error in a string representation.

type RenderingOptions

type RenderingOptions struct {
	Prefix, Postfix string
}

RenderingOptions describes options for rendering.

Jump to

Keyboard shortcuts

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