nginx

package
v0.0.0-...-5998bd7 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidReceiver = fmt.Errorf("receiver must be compatible with *Line")

ErrInvalidReceiver is raised when an invalid receiver is provided

View Source
var ErrInvalidSyntax = fmt.Errorf("invalid syntax")

ErrInvalidSyntax is raised when a line cannot be understood

View Source
var ErrNullReceiver = fmt.Errorf("receiver must not be null")

ErrNullReceiver is raised when a null receiver is provided

View Source
var ErrUnclosedSection = fmt.Errorf("unclosed section")

ErrUnclosedSection is raised when there is unclosed sections reaching the end of the file

View Source
var ErrUnexpectedSectionClose = fmt.Errorf("unexpected section close")

ErrUnexpectedSectionClose is raised when reading a section close '}' without an open section

Functions

This section is empty.

Types

type Decoder

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

Decoder implements parser.Decoder

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder implements parser.T

func (*Decoder) Decode

func (d *Decoder) Decode(v interface{}) error

Decode is the main function of the parser.Decoder interface

type Encoder

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

Encoder implements parser.Encoder

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder implements parser.T

func (*Encoder) Encode

func (e *Encoder) Encode(v interface{}) error

Encode is the main function of the parser.Encoder interface

func (*Encoder) SetIndent

func (e *Encoder) SetIndent(prefix, indent string)

SetIndent with the <prefix> that begins each line (default is emptys string) and the <indent> string repeated for each indentation level (default is tab '\t')

type Line

type Line struct {
	// Type of line
	Type LineType

	// Components of the line
	Components []string

	// Lines children of the current section (nil if not a section)
	Lines []*Line
}

Line represents a meaningful line

type LineError

type LineError struct {
	Line int
	Err  error
}

LineError wraps errors with a line index

func (LineError) Error

func (le LineError) Error() string

Error implements Error

type LineType

type LineType byte

LineType enumerates available line types

const (
	// NONE is the default line type (invalid syntax)
	NONE LineType = iota
	// COMMENT represents a #-comment
	COMMENT
	// COLONCOMMENT represents a ;-comment
	COLONCOMMENT
	// ASSIGNMENT line
	ASSIGNMENT
	// INCLUDE  line
	INCLUDE
	// SECTION start
	SECTION
	// SECTIONEND line '}'
	SECTIONEND
)

Jump to

Keyboard shortcuts

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