trace

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LineLimit defines how many lines before and after
	// the calling function to retrieve.
	LineLimit = 60
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	File     string
	Line     int
	Function string
	Contents string
	Language string
}

FileStack defines the stack used for the error page

func (*File) Lines

func (f *File) Lines() []*FileLine

Lines

Splits the file into a array of lines by separating them by a new line.

func (*File) Vendor

func (f *File) Vendor() bool

Vendor

Determines if a file is Verbis specific or vendor.

type FileLine

type FileLine struct {
	Line    int
	Content string
}

FileLine defines the error for templating it includes the line & content of the error file.

type Stack

type Stack []*File

Stack defines the slice of file lines for recovery

func (*Stack) Append

func (s *Stack) Append(file *File)

Append a file to the stack trace

func (*Stack) Find

func (s *Stack) Find(fn string) *File

Find a file in the stack by function.

func (*Stack) Prepend

func (s *Stack) Prepend(file *File)

Prepend a file to the stack trace (useful for templates)

type Tracer

type Tracer interface {
	Trace(depth int, skip int) Stack
}

Tracer represents the functionality for obtaining a new stack.

func New

func New() Tracer

New returns a new tracer

Jump to

Keyboard shortcuts

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