proto

package
v0.0.0-...-c2f74b2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Key, Value string
}

type Reader

type Reader interface {
	ReadSentence() (*Sentence, error)
}

Reader reads RouterOS tokens from another reader.

func NewReader

func NewReader(r io.Reader) Reader

NewReader returns a new Reader to read from r.

type Sentence

type Sentence struct {
	// Word that begins with !
	Word string
	Tag  string
	List []Pair
	Map  map[string]string
}

Sentence is a line read from a RouterOS device.

func NewSentence

func NewSentence() *Sentence

func (*Sentence) String

func (sen *Sentence) String() string

type Writer

type Writer struct {
	io.Writer

	sync.Mutex
	// contains filtered or unexported fields
}

Writer writes words to a RouterOS device.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter returns a new Writer to write to w.

func (*Writer) BeginSentence

func (w *Writer) BeginSentence()

BeginSentence simply calls Lock().

func (*Writer) EndSentence

func (w *Writer) EndSentence() error

EndSentence writes an empty word and calls Unlock(). It returns Err().

func (*Writer) Err

func (w *Writer) Err() error

Err returns the last error that occurred on this Writer.

func (*Writer) Printf

func (w *Writer) Printf(format string, a ...interface{})

func (*Writer) WriteWord

func (w *Writer) WriteWord(word string)

WriteWord writes one RouterOS word.

Jump to

Keyboard shortcuts

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