ros

package module
v0.0.0-...-2d88399 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 12 Imported by: 0

README

Simple RouterOS Library

Documentation

Index

Constants

View Source
const (
	DefaultPort     = 22
	DefaultUsername = "admin"
	DefaultPassword = ""
	DefaultTimeout  = 30 * time.Second
)

Variables

This section is empty.

Functions

func FormatBool

func FormatBool(b bool) string

func ParseBool

func ParseBool(x string) bool

func Password

func Password(password string) func(*Ros) error

func Port

func Port(port int) func(*Ros) error

func RouterOsVersion

func RouterOsVersion(version string) (int, int)

func ScanFirstNumberedItemList

func ScanFirstNumberedItemList(results string) (map[string]string, error)

Take the first entry, usually after applying a filter.

func ScanItems

func ScanItems(results string) (map[string]string, error)

<ws><key>:[<value>...]<nl>

func ScanNumberedItemList

func ScanNumberedItemList(results string) ([]map[string]string, error)

Scan a set of numbered items, this may be preceded with a Flags line.

func Timeout

func Timeout(timeout time.Duration) func(*Ros) error

func Username

func Username(username string) func(*Ros) error

Types

type Command

type Command struct {
	Path    string            // base path to use
	Command string            // command to run
	UParam  *string           // possible unnamed parameter
	Params  map[string]string // possible named parameters
	Extra   map[string]string // extra unsearchable parameters
	Flags   map[string]bool   // possible boolean options to set
	Filter  map[string]string // possible recovery filter to apply
	Detail  bool              // is a detailed print required
}

Comand represents a basic CLI request.

func (Command) Exec

func (c Command) Exec(client *ssh.Client) error

func (Command) First

func (c Command) First(client *ssh.Client) (map[string]string, error)

func (Command) List

func (c Command) List(client *ssh.Client) ([]map[string]string, error)

func (Command) Parse

func (c Command) Parse() (string, error)

func (Command) Run

func (c Command) Run(client *ssh.Client) ([]string, error)

func (Command) UnnumberedList

func (c Command) UnnumberedList(client *ssh.Client, offset int) ([]map[string]string, error)

func (Command) Values

func (c Command) Values(client *ssh.Client) (map[string]string, error)

type Ros

type Ros struct {
	// contains filtered or unexported fields
}

func NewRos

func NewRos(hostname string, options ...func(*Ros) error) (*Ros, error)

func (*Ros) AddInterfaceList

func (r *Ros) AddInterfaceList(list string, params map[string]string) error

func (*Ros) AddInterfaceListMember

func (r *Ros) AddInterfaceListMember(iface, list string, params map[string]string) error

func (*Ros) AddIpFirewallAddressList

func (r *Ros) AddIpFirewallAddressList(address, list string, params map[string]string) error

func (*Ros) AddIpFirewallFilter

func (r *Ros) AddIpFirewallFilter(chain string, params []map[string]string) error

func (*Ros) AddIpFirewallNat

func (r *Ros) AddIpFirewallNat(params map[string]string) error

func (*Ros) AddRadius

func (r *Ros) AddRadius(service string) error

func (*Ros) AddRoutingFilter

func (r *Ros) AddRoutingFilter(params map[string]string) error

func (*Ros) AddSnmpCommunity

func (r *Ros) AddSnmpCommunity(name string) error

func (*Ros) AddSystemLogging

func (r *Ros) AddSystemLogging(action, topics string) error

func (*Ros) AddSystemScheduler

func (r *Ros) AddSystemScheduler(name, interval, policy, onevent string) error

func (*Ros) AddSystemScript

func (r *Ros) AddSystemScript(name, policy, source string) error

func (*Ros) AddToolNetwatch

func (r *Ros) AddToolNetwatch(host, up_script, down_script, interval, timeout string, disabled bool) error

func (*Ros) AddToolRomonPort

func (r *Ros) AddToolRomonPort(iface string) error

func (*Ros) AddUser

func (r *Ros) AddUser(name, group, password string) error

func (*Ros) AtLeast

func (r *Ros) AtLeast(major, minor int) bool

func (*Ros) Close

func (r *Ros) Close() error

func (*Ros) Connect

func (r *Ros) Connect() error

func (*Ros) Error

func (r *Ros) Error() error

func (*Ros) Exec

func (r *Ros) Exec(c Command) error

func (*Ros) Export

func (r *Ros) Export(path string, hide, verbose bool) ([]string, error)

func (*Ros) ExportFile

func (r *Ros) ExportFile(path, file string, hide, verbose bool) ([]string, error)

func (*Ros) First

func (r *Ros) First(c Command) (map[string]string, error)

func (*Ros) HasCloud

func (r *Ros) HasCloud() bool

func (*Ros) HasLegacyCloud

func (r *Ros) HasLegacyCloud() bool

func (*Ros) HasLegacyRomon

func (r *Ros) HasLegacyRomon() bool

func (*Ros) HasRomon

func (r *Ros) HasRomon() bool

func (*Ros) Id

func (r *Ros) Id() string

func (*Ros) InterfaceBridge

func (r *Ros) InterfaceBridge(name string) (map[string]string, error)

func (*Ros) InterfaceBridgeHosts

func (r *Ros) InterfaceBridgeHosts() ([]map[string]string, error)

func (*Ros) InterfaceBridgePort

func (r *Ros) InterfaceBridgePort(bridge, iface string) (map[string]string, error)

func (*Ros) InterfaceBridgePorts

func (r *Ros) InterfaceBridgePorts() ([]map[string]string, error)

func (*Ros) InterfaceBridges

func (r *Ros) InterfaceBridges() ([]map[string]string, error)

func (*Ros) InterfaceEthernet

func (r *Ros) InterfaceEthernet(name string) (map[string]string, error)

func (*Ros) InterfaceEthernets

func (r *Ros) InterfaceEthernets() ([]map[string]string, error)

func (*Ros) InterfaceGre

func (r *Ros) InterfaceGre(address string) (map[string]string, error)

func (*Ros) InterfaceGres

func (r *Ros) InterfaceGres() ([]map[string]string, error)

func (*Ros) InterfaceList

func (r *Ros) InterfaceList(list string) (map[string]string, error)

func (*Ros) InterfaceListMember

func (r *Ros) InterfaceListMember(iface, list string) (map[string]string, error)

func (*Ros) InterfaceWireless

func (r *Ros) InterfaceWireless(name string) (map[string]string, error)

func (*Ros) InterfaceWirelesses

func (r *Ros) InterfaceWirelesses() ([]map[string]string, error)

func (*Ros) Interfaces

func (r *Ros) Interfaces() ([]map[string]string, error)

func (*Ros) IpAddress

func (r *Ros) IpAddress(address string) (map[string]string, error)

func (*Ros) IpAddresses

func (r *Ros) IpAddresses() ([]map[string]string, error)

func (Ros) IpArps

func (r Ros) IpArps() ([]map[string]string, error)

func (*Ros) IpCloud

func (r *Ros) IpCloud() (map[string]string, error)

func (*Ros) IpDns

func (r *Ros) IpDns() (map[string]string, error)

func (*Ros) IpFirewallAddressList

func (r *Ros) IpFirewallAddressList(address, list string) (map[string]string, error)

func (*Ros) IpFirewallFilter

func (r *Ros) IpFirewallFilter(chain string) ([]map[string]string, error)

func (*Ros) IpFirewallNat

func (r *Ros) IpFirewallNat(filter map[string]string) (map[string]string, error)

func (Ros) IpNeighbors

func (r Ros) IpNeighbors() ([]map[string]string, error)

func (*Ros) IpRoute

func (r *Ros) IpRoute(address string) (map[string]string, error)

func (*Ros) IpRoutes

func (r *Ros) IpRoutes(static bool) ([]map[string]string, error)

func (*Ros) IpService

func (r *Ros) IpService(name string) (map[string]string, error)

func (*Ros) IpSocks

func (r *Ros) IpSocks() (map[string]string, error)

func (*Ros) IpSsh

func (r *Ros) IpSsh() (map[string]string, error)

func (*Ros) List

func (r *Ros) List(c Command) ([]map[string]string, error)

func (*Ros) Major

func (r *Ros) Major() int

func (*Ros) Minor

func (r *Ros) Minor() int

func (*Ros) Parse

func (r *Ros) Parse(c Command) (string, error)

func (*Ros) Radius

func (r *Ros) Radius(service string) (map[string]string, error)

func (*Ros) RadiusIncoming

func (r *Ros) RadiusIncoming() (map[string]string, error)

func (*Ros) RemoveInterfaceList

func (r *Ros) RemoveInterfaceList(list string) error

func (*Ros) RemoveInterfaceListMember

func (r *Ros) RemoveInterfaceListMember(iface, list string) error

func (*Ros) RemoveIpFirewallAddressList

func (r *Ros) RemoveIpFirewallAddressList(address, list string) error

func (*Ros) RemoveIpFirewallFilter

func (r *Ros) RemoveIpFirewallFilter(chain string) error

func (*Ros) RemoveIpFirewallNat

func (r *Ros) RemoveIpFirewallNat(filter map[string]string) error

func (*Ros) RemoveRadius

func (r *Ros) RemoveRadius(service string) error

func (*Ros) RemoveRoutingFilter

func (r *Ros) RemoveRoutingFilter(filter map[string]string) error

func (*Ros) RemoveSnmpCommunity

func (r *Ros) RemoveSnmpCommunity(name string) error

func (*Ros) RemoveSystemLogging

func (r *Ros) RemoveSystemLogging(action, topics string) error

func (*Ros) RemoveSystemScheduler

func (r *Ros) RemoveSystemScheduler(name string) error

func (*Ros) RemoveSystemScript

func (r *Ros) RemoveSystemScript(name string) error

func (*Ros) RemoveToolNetwatch

func (r *Ros) RemoveToolNetwatch(host string) error

func (*Ros) RemoveToolRomonPort

func (r *Ros) RemoveToolRomonPort(iface string) error

func (*Ros) RemoveUser

func (r *Ros) RemoveUser(name string) error

func (*Ros) Routerboard

func (r *Ros) Routerboard() bool

func (*Ros) RoutingBgpAggregate

func (r *Ros) RoutingBgpAggregate(instance, prefix string) (map[string]string, error)

func (*Ros) RoutingBgpAggregates

func (r *Ros) RoutingBgpAggregates() ([]map[string]string, error)

func (*Ros) RoutingBgpInstance

func (r *Ros) RoutingBgpInstance(name string) (map[string]string, error)

func (*Ros) RoutingBgpInstances

func (r *Ros) RoutingBgpInstances() ([]map[string]string, error)

func (*Ros) RoutingBgpNetwork

func (r *Ros) RoutingBgpNetwork(network string) (map[string]string, error)

func (*Ros) RoutingBgpNetworks

func (r *Ros) RoutingBgpNetworks() ([]map[string]string, error)

func (*Ros) RoutingBgpPeer

func (r *Ros) RoutingBgpPeer(addr string) (map[string]string, error)

func (*Ros) RoutingBgpPeers

func (r *Ros) RoutingBgpPeers() ([]map[string]string, error)

func (*Ros) RoutingFilter

func (r *Ros) RoutingFilter(filter map[string]string) (map[string]string, error)

func (*Ros) RoutingFilterChain

func (r *Ros) RoutingFilterChain(chain string) ([]map[string]string, error)

func (*Ros) RoutingOspfInstance

func (r *Ros) RoutingOspfInstance(name string) (map[string]string, error)

func (*Ros) RoutingOspfInstances

func (r *Ros) RoutingOspfInstances() ([]map[string]string, error)

func (*Ros) RoutingOspfInterface

func (r *Ros) RoutingOspfInterface(iface string) (map[string]string, error)

func (*Ros) RoutingOspfInterfaces

func (r *Ros) RoutingOspfInterfaces() ([]map[string]string, error)

func (*Ros) RoutingOspfNbmaNeighbor

func (r *Ros) RoutingOspfNbmaNeighbor(address string) (map[string]string, error)

func (*Ros) RoutingOspfNbmaNeighbors

func (r *Ros) RoutingOspfNbmaNeighbors() ([]map[string]string, error)

func (*Ros) RoutingOspfNetwork

func (r *Ros) RoutingOspfNetwork(network string) (map[string]string, error)

func (*Ros) RoutingOspfNetworks

func (r *Ros) RoutingOspfNetworks() ([]map[string]string, error)

func (*Ros) Run

func (r *Ros) Run(c Command) ([]string, error)

func (*Ros) SetInterfaceBridgeComment

func (r *Ros) SetInterfaceBridgeComment(name, comment string) error

func (*Ros) SetInterfaceBridgePortComment

func (r *Ros) SetInterfaceBridgePortComment(bridge, iface, comment string) error

func (*Ros) SetInterfaceBridgePriority

func (r *Ros) SetInterfaceBridgePriority(name, priority string) error

func (*Ros) SetInterfaceBridgeProtocolMode

func (r *Ros) SetInterfaceBridgeProtocolMode(name, mode string) error

func (*Ros) SetInterfaceEthernetComment

func (r *Ros) SetInterfaceEthernetComment(name, comment string) error

func (*Ros) SetInterfaceEthernetMtu

func (r *Ros) SetInterfaceEthernetMtu(name, mtu string) error

func (*Ros) SetInterfaceGreAllowFastPath

func (r *Ros) SetInterfaceGreAllowFastPath(address string, allow bool) error

func (*Ros) SetInterfaceGreClampTcpMss

func (r *Ros) SetInterfaceGreClampTcpMss(address string, clamp bool) error

func (*Ros) SetInterfaceGreComment

func (r *Ros) SetInterfaceGreComment(address, comment string) error

func (*Ros) SetInterfaceGreKeepalive

func (r *Ros) SetInterfaceGreKeepalive(address, alive string) error

func (*Ros) SetInterfaceGreMtu

func (r *Ros) SetInterfaceGreMtu(address, mtu string) error

func (*Ros) SetInterfaceGreName

func (r *Ros) SetInterfaceGreName(address, name string) error

func (*Ros) SetInterfaceListComment

func (r *Ros) SetInterfaceListComment(list, comment string) error

func (*Ros) SetInterfaceListMemberComment

func (r *Ros) SetInterfaceListMemberComment(iface, list, comment string) error

func (*Ros) SetInterfaceListMemberDisabled

func (r *Ros) SetInterfaceListMemberDisabled(iface, list string, disabled bool) error

func (*Ros) SetInterfaceWirelessComment

func (r *Ros) SetInterfaceWirelessComment(name, comment string) error

func (*Ros) SetIpAddressComment

func (r *Ros) SetIpAddressComment(address, comment string) error

func (*Ros) SetIpCloudDdnsEnabled

func (r *Ros) SetIpCloudDdnsEnabled(enabled bool) error

func (*Ros) SetIpCloudUpdateTime

func (r *Ros) SetIpCloudUpdateTime(update bool) error

func (*Ros) SetIpDnsAllowRemoteRequests

func (r *Ros) SetIpDnsAllowRemoteRequests(allow bool) error

func (*Ros) SetIpDnsServers

func (r *Ros) SetIpDnsServers(servers string) error

func (*Ros) SetIpFirewallAddressListComment

func (r *Ros) SetIpFirewallAddressListComment(address, list, comment string) error

func (*Ros) SetIpFirewallAddressListDisabled

func (r *Ros) SetIpFirewallAddressListDisabled(address, list string, disabled bool) error

func (*Ros) SetIpFirewallNatComment

func (r *Ros) SetIpFirewallNatComment(filter map[string]string, comment string) error

func (*Ros) SetIpFirewallNatDisabled

func (r *Ros) SetIpFirewallNatDisabled(filter map[string]string, disabled bool) error

func (*Ros) SetIpRouteComment

func (r *Ros) SetIpRouteComment(address, comment string) error

func (*Ros) SetIpServiceAddress

func (r *Ros) SetIpServiceAddress(name, address string) error

func (*Ros) SetIpServiceDisabled

func (r *Ros) SetIpServiceDisabled(name string, disabled bool) error

func (*Ros) SetIpServicePort

func (r *Ros) SetIpServicePort(name string, port int) error

func (*Ros) SetIpSocksConnectionIdleTimeout

func (r *Ros) SetIpSocksConnectionIdleTimeout(timeout string) error

func (*Ros) SetIpSocksEnabled

func (r *Ros) SetIpSocksEnabled(enabled bool) error

func (*Ros) SetIpSocksMaxConnections

func (r *Ros) SetIpSocksMaxConnections(connections int) error

func (*Ros) SetIpSocksPort

func (r *Ros) SetIpSocksPort(port int) error

func (*Ros) SetIpSshAlwaysAllowPasswordLogin

func (r *Ros) SetIpSshAlwaysAllowPasswordLogin(allow bool) error

func (*Ros) SetIpSshForwardingEnabled

func (r *Ros) SetIpSshForwardingEnabled(forwarding bool) error

func (*Ros) SetIpSshHostKeySize

func (r *Ros) SetIpSshHostKeySize(size int) error

func (*Ros) SetIpSshStrongCrypto

func (r *Ros) SetIpSshStrongCrypto(strong bool) error

func (*Ros) SetRadiusAddress

func (r *Ros) SetRadiusAddress(service, address string) error

func (*Ros) SetRadiusDisabled

func (r *Ros) SetRadiusDisabled(service string, disabled bool) error

func (*Ros) SetRadiusIncomingAccept

func (r *Ros) SetRadiusIncomingAccept(accept bool) error

func (*Ros) SetRadiusIncomingPort

func (r *Ros) SetRadiusIncomingPort(port int) error

func (*Ros) SetRadiusSecret

func (r *Ros) SetRadiusSecret(service, secret string) error

func (*Ros) SetRadiusSrcAddress

func (r *Ros) SetRadiusSrcAddress(service, address string) error

func (*Ros) SetRadiusTimeout

func (r *Ros) SetRadiusTimeout(service, timeout string) error

func (*Ros) SetRoutingBgpAggregateComment

func (r *Ros) SetRoutingBgpAggregateComment(instance, prefix, comment string) error

func (*Ros) SetRoutingBgpInstanceComment

func (r *Ros) SetRoutingBgpInstanceComment(name, comment string) error

func (*Ros) SetRoutingBgpInstanceRouterId

func (r *Ros) SetRoutingBgpInstanceRouterId(name, router_id string) error

func (*Ros) SetRoutingBgpNetworkComment

func (r *Ros) SetRoutingBgpNetworkComment(network, comment string) error

func (*Ros) SetRoutingBgpPeerComment

func (r *Ros) SetRoutingBgpPeerComment(addr, comment string) error

func (*Ros) SetRoutingBgpPeerName

func (r *Ros) SetRoutingBgpPeerName(addr, name string) error

func (*Ros) SetRoutingFilterComment

func (r *Ros) SetRoutingFilterComment(filter map[string]string, comment string) error

func (*Ros) SetRoutingFilterDisabled

func (r *Ros) SetRoutingFilterDisabled(filter map[string]string, disabled bool) error

func (*Ros) SetRoutingOspfInstanceComment

func (r *Ros) SetRoutingOspfInstanceComment(name, comment string) error

func (*Ros) SetRoutingOspfInstanceRouterId

func (r *Ros) SetRoutingOspfInstanceRouterId(name, router_id string) error

func (*Ros) SetRoutingOspfInterfaceComment

func (r *Ros) SetRoutingOspfInterfaceComment(iface, comment string) error

func (*Ros) SetRoutingOspfInterfaceCost

func (r *Ros) SetRoutingOspfInterfaceCost(iface, cost string) error

func (*Ros) SetRoutingOspfNbmaNeighborComment

func (r *Ros) SetRoutingOspfNbmaNeighborComment(address, comment string) error

func (*Ros) SetRoutingOspfNbmaNeighborPollInterval

func (r *Ros) SetRoutingOspfNbmaNeighborPollInterval(address, interval string) error

func (*Ros) SetRoutingOspfNbmaNeighborPriority

func (r *Ros) SetRoutingOspfNbmaNeighborPriority(address string, priority int) error

func (*Ros) SetRoutingOspfNetworkComment

func (r *Ros) SetRoutingOspfNetworkComment(network, comment string) error

func (*Ros) SetSnmpCommunityAddresses

func (r *Ros) SetSnmpCommunityAddresses(name, addresses string) error

func (*Ros) SetSnmpCommunityAuthenticationPassword

func (r *Ros) SetSnmpCommunityAuthenticationPassword(name, password string) error

func (*Ros) SetSnmpCommunityAuthenticationProtocol

func (r *Ros) SetSnmpCommunityAuthenticationProtocol(name, protocol string) error

func (*Ros) SetSnmpCommunityDefaultAddresses

func (r *Ros) SetSnmpCommunityDefaultAddresses(addresses string) error

func (*Ros) SetSnmpCommunityDefaultAuthenticationPassword

func (r *Ros) SetSnmpCommunityDefaultAuthenticationPassword(password string) error

func (*Ros) SetSnmpCommunityDefaultAuthenticationProtocol

func (r *Ros) SetSnmpCommunityDefaultAuthenticationProtocol(protocol string) error

func (*Ros) SetSnmpCommunityDefaultEncryptionPassword

func (r *Ros) SetSnmpCommunityDefaultEncryptionPassword(password string) error

func (*Ros) SetSnmpCommunityDefaultEncryptionProtocol

func (r *Ros) SetSnmpCommunityDefaultEncryptionProtocol(protocol string) error

func (*Ros) SetSnmpCommunityDefaultName

func (r *Ros) SetSnmpCommunityDefaultName(name string) error

func (*Ros) SetSnmpCommunityDefaultReadAccess

func (r *Ros) SetSnmpCommunityDefaultReadAccess(access bool) error

func (*Ros) SetSnmpCommunityDefaultSecurity

func (r *Ros) SetSnmpCommunityDefaultSecurity(security string) error

func (*Ros) SetSnmpCommunityDefaultWriteAccess

func (r *Ros) SetSnmpCommunityDefaultWriteAccess(access bool) error

func (*Ros) SetSnmpCommunityEncryptionPassword

func (r *Ros) SetSnmpCommunityEncryptionPassword(name, password string) error

func (*Ros) SetSnmpCommunityEncryptionProtocol

func (r *Ros) SetSnmpCommunityEncryptionProtocol(name, protocol string) error

func (*Ros) SetSnmpCommunityReadAccess

func (r *Ros) SetSnmpCommunityReadAccess(name string, access bool) error

func (*Ros) SetSnmpCommunitySecurity

func (r *Ros) SetSnmpCommunitySecurity(name, security string) error

func (*Ros) SetSnmpCommunityWriteAccess

func (r *Ros) SetSnmpCommunityWriteAccess(name string, access bool) error

func (*Ros) SetSnmpContact

func (r *Ros) SetSnmpContact(contact string) error

func (*Ros) SetSnmpEnabled

func (r *Ros) SetSnmpEnabled(enabled bool) error

func (*Ros) SetSnmpEngineId

func (r *Ros) SetSnmpEngineId(id string) error

func (*Ros) SetSnmpLocation

func (r *Ros) SetSnmpLocation(location string) error

func (*Ros) SetSnmpTrapCommunity

func (r *Ros) SetSnmpTrapCommunity(community string) error

func (*Ros) SetSnmpTrapGenerators

func (r *Ros) SetSnmpTrapGenerators(generators string) error

func (*Ros) SetSnmpTrapTarget

func (r *Ros) SetSnmpTrapTarget(target string) error

func (*Ros) SetSnmpTrapVersion

func (r *Ros) SetSnmpTrapVersion(version int) error

func (*Ros) SetSystemClockTimeZoneAutodetect

func (r *Ros) SetSystemClockTimeZoneAutodetect(auto bool) error

func (*Ros) SetSystemClockTimeZoneName

func (r *Ros) SetSystemClockTimeZoneName(zone string) error

func (*Ros) SetSystemIdentityName

func (r *Ros) SetSystemIdentityName(name string) error

func (*Ros) SetSystemLoggingActionBsdSyslog

func (r *Ros) SetSystemLoggingActionBsdSyslog(name string, bsd bool) error

func (*Ros) SetSystemLoggingActionRemote

func (r *Ros) SetSystemLoggingActionRemote(name, remote string) error

func (*Ros) SetSystemLoggingActionRemotePort

func (r *Ros) SetSystemLoggingActionRemotePort(name string, port int) error

func (*Ros) SetSystemLoggingActionSrcAddress

func (r *Ros) SetSystemLoggingActionSrcAddress(name string, address string) error

func (*Ros) SetSystemLoggingActionSyslogFacility

func (r *Ros) SetSystemLoggingActionSyslogFacility(name, facility string) error

func (*Ros) SetSystemLoggingActionSyslogSeverity

func (r *Ros) SetSystemLoggingActionSyslogSeverity(name, severity string) error

func (*Ros) SetSystemLoggingActionTarget

func (r *Ros) SetSystemLoggingActionTarget(name, target string) error

func (*Ros) SetSystemLoggingPrefix

func (r *Ros) SetSystemLoggingPrefix(action, topics, prefix string) error

func (*Ros) SetSystemNote

func (r *Ros) SetSystemNote(note string) error

func (*Ros) SetSystemNoteShowAtLogin

func (r *Ros) SetSystemNoteShowAtLogin(show bool) error

func (*Ros) SetSystemNtpClientEnabled

func (r *Ros) SetSystemNtpClientEnabled(enabled bool) error

func (*Ros) SetSystemNtpClientPrimaryNtp

func (r *Ros) SetSystemNtpClientPrimaryNtp(zone string) error

func (*Ros) SetSystemNtpClientSecondaryNtp

func (r *Ros) SetSystemNtpClientSecondaryNtp(zone string) error

func (*Ros) SetSystemSchedulerComment

func (r *Ros) SetSystemSchedulerComment(name, comment string) error

func (*Ros) SetSystemSchedulerInterval

func (r *Ros) SetSystemSchedulerInterval(name, interval string) error

func (*Ros) SetSystemSchedulerOnEvent

func (r *Ros) SetSystemSchedulerOnEvent(name, onevent string) error

func (*Ros) SetSystemSchedulerPolicy

func (r *Ros) SetSystemSchedulerPolicy(name, policy string) error

func (*Ros) SetSystemSchedulerStartDate

func (r *Ros) SetSystemSchedulerStartDate(name, startdate string) error

func (*Ros) SetSystemSchedulerStartTime

func (r *Ros) SetSystemSchedulerStartTime(name, starttime string) error

func (*Ros) SetSystemSchedulerStartup

func (r *Ros) SetSystemSchedulerStartup(name string, startup bool) error

func (*Ros) SetSystemScriptPolicy

func (r *Ros) SetSystemScriptPolicy(name, policy string) error

func (*Ros) SetSystemScriptSource

func (r *Ros) SetSystemScriptSource(name, source string) error

func (*Ros) SetToolBandwidthServerAllocateUdpPortsFrom

func (r *Ros) SetToolBandwidthServerAllocateUdpPortsFrom(port int) error

func (*Ros) SetToolBandwidthServerAuthenticate

func (r *Ros) SetToolBandwidthServerAuthenticate(auth bool) error

func (*Ros) SetToolBandwidthServerEnabled

func (r *Ros) SetToolBandwidthServerEnabled(enabled bool) error

func (*Ros) SetToolBandwidthServerMaxSessions

func (r *Ros) SetToolBandwidthServerMaxSessions(sessions int) error

func (*Ros) SetToolMacServerAllowedInterfaceList

func (r *Ros) SetToolMacServerAllowedInterfaceList(list string) error

func (*Ros) SetToolMacServerDisabled

func (r *Ros) SetToolMacServerDisabled(disabled bool) error

func (*Ros) SetToolMacServerMacWinboxAllowedInterfaceList

func (r *Ros) SetToolMacServerMacWinboxAllowedInterfaceList(list string) error

func (*Ros) SetToolMacServerMacWinboxDisabled

func (r *Ros) SetToolMacServerMacWinboxDisabled(disabled bool) error

func (*Ros) SetToolMacServerPingEnabled

func (r *Ros) SetToolMacServerPingEnabled(enabled bool) error

func (*Ros) SetToolNetwatchComment

func (r *Ros) SetToolNetwatchComment(host, comment string) error

func (*Ros) SetToolNetwatchDisabled

func (r *Ros) SetToolNetwatchDisabled(host string, disabled bool) error

func (*Ros) SetToolNetwatchDownScript

func (r *Ros) SetToolNetwatchDownScript(host, down_script string) error

func (*Ros) SetToolNetwatchInterval

func (r *Ros) SetToolNetwatchInterval(host, interval string) error

func (*Ros) SetToolNetwatchTimeout

func (r *Ros) SetToolNetwatchTimeout(host, timeout string) error

func (*Ros) SetToolNetwatchUpScript

func (r *Ros) SetToolNetwatchUpScript(host, up_script string) error

func (*Ros) SetToolRomonEnabled

func (r *Ros) SetToolRomonEnabled(enabled bool) error

func (*Ros) SetToolRomonId

func (r *Ros) SetToolRomonId(id string) error

func (*Ros) SetToolRomonPortCost

func (r *Ros) SetToolRomonPortCost(iface string, cost int) error

func (*Ros) SetToolRomonPortDefaultCost

func (r *Ros) SetToolRomonPortDefaultCost(cost int) error

func (*Ros) SetToolRomonPortDefaultDisabled

func (r *Ros) SetToolRomonPortDefaultDisabled(disabled bool) error

func (*Ros) SetToolRomonPortDefaultForbid

func (r *Ros) SetToolRomonPortDefaultForbid(forbid bool) error

func (*Ros) SetToolRomonPortDefaultSecrets

func (r *Ros) SetToolRomonPortDefaultSecrets(secrets string) error

func (*Ros) SetToolRomonPortDisabled

func (r *Ros) SetToolRomonPortDisabled(iface string, disabled bool) error

func (*Ros) SetToolRomonPortForbid

func (r *Ros) SetToolRomonPortForbid(iface string, forbid bool) error

func (*Ros) SetToolRomonPortSecrets

func (r *Ros) SetToolRomonPortSecrets(iface, secrets string) error

func (*Ros) SetToolRomonSecrets

func (r *Ros) SetToolRomonSecrets(secrets string) error

func (*Ros) SetUserAaaAccounting

func (r *Ros) SetUserAaaAccounting(enabled bool) error

func (*Ros) SetUserAaaDefaultGroup

func (r *Ros) SetUserAaaDefaultGroup(group string) error

func (*Ros) SetUserAaaExcludeGroups

func (r *Ros) SetUserAaaExcludeGroups(groups string) error

func (*Ros) SetUserAaaInterimUpdate

func (r *Ros) SetUserAaaInterimUpdate(update string) error

func (*Ros) SetUserAaaUseRadius

func (r *Ros) SetUserAaaUseRadius(enabled bool) error

func (*Ros) SetUserAddress

func (r *Ros) SetUserAddress(name, address string) error

func (*Ros) SetUserComment

func (r *Ros) SetUserComment(name, comment string) error

func (*Ros) SetUserGroup

func (r *Ros) SetUserGroup(name, group string) error

func (*Ros) SetUserPassword

func (r *Ros) SetUserPassword(name, password string) error

func (*Ros) Snmp

func (r *Ros) Snmp() (map[string]string, error)

func (*Ros) SnmpCommunity

func (r *Ros) SnmpCommunity(name string) (map[string]string, error)

func (*Ros) SnmpCommunityDefault

func (r *Ros) SnmpCommunityDefault() (map[string]string, error)

func (*Ros) SystemClock

func (r *Ros) SystemClock() (map[string]string, error)

func (*Ros) SystemIdentity

func (r *Ros) SystemIdentity() (map[string]string, error)

func (*Ros) SystemLogging

func (r *Ros) SystemLogging(action, topics string) (map[string]string, error)

func (*Ros) SystemLoggingAction

func (r *Ros) SystemLoggingAction(name string) (map[string]string, error)

func (*Ros) SystemNote

func (r *Ros) SystemNote() (map[string]string, error)

func (*Ros) SystemNtpClient

func (r *Ros) SystemNtpClient() (map[string]string, error)

func (*Ros) SystemResource

func (r *Ros) SystemResource() (map[string]string, error)

func (*Ros) SystemRouterboard

func (r *Ros) SystemRouterboard() (map[string]string, error)

func (*Ros) SystemScheduler

func (r *Ros) SystemScheduler(name string) (map[string]string, error)

func (*Ros) SystemScript

func (r *Ros) SystemScript(name string) (map[string]string, error)

func (*Ros) ToolBandwidthServer

func (r *Ros) ToolBandwidthServer() (map[string]string, error)

func (*Ros) ToolMacServer

func (r *Ros) ToolMacServer() (map[string]string, error)

func (*Ros) ToolMacServerMacWinbox

func (r *Ros) ToolMacServerMacWinbox() (map[string]string, error)

func (*Ros) ToolMacServerPing

func (r *Ros) ToolMacServerPing() (map[string]string, error)

func (*Ros) ToolNetwatch

func (r *Ros) ToolNetwatch(host string) (map[string]string, error)

func (*Ros) ToolRomon

func (r *Ros) ToolRomon() (map[string]string, error)

func (*Ros) ToolRomonPort

func (r *Ros) ToolRomonPort(iface string) (map[string]string, error)

func (*Ros) ToolRomonPortDefault

func (r *Ros) ToolRomonPortDefault() (map[string]string, error)

func (*Ros) UnnumberedList

func (r *Ros) UnnumberedList(c Command, header int) ([]map[string]string, error)

func (*Ros) User

func (r *Ros) User(name string) (map[string]string, error)

func (*Ros) UserAaa

func (r *Ros) UserAaa() (map[string]string, error)

func (*Ros) Values

func (r *Ros) Values(c Command) (map[string]string, error)

func (*Ros) Version

func (r *Ros) Version() error

type Scanner

type Scanner struct {
	scanner.Scanner
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(str string) Scanner

func (*Scanner) Next

func (s *Scanner) Next() bool

Next iterates over all tokens. Retrieve the most recent token with Token(). It returns false once it reaches token.EOF.

func (*Scanner) String

func (s *Scanner) String() string

func (*Scanner) Token

func (s *Scanner) Token() Token

func (*Scanner) Type

func (s *Scanner) Type() rune

type Token

type Token struct {
	Type rune
	Peek rune
	Text string
}

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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