location

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CallerAwareModePreferFile     CallerAwareMode = 0
	CallerAwareModePreferFunction CallerAwareMode = 1

	CallerAwareDetailSimplified CallerAwareDetail = 0
	CallerAwareDetailDetailed   CallerAwareDetail = 1
)

Variables

View Source
var (
	DefaultFactory       = NewCallerAwareFactory(CallerAwareModePreferFile, CallerAwareDetailSimplified)
	DefaultFactoryFacade = NewFacade(func() Factory {
		return DefaultFactory
	})
)

Functions

This section is empty.

Types

type CallerAware

type CallerAware interface {
	Location

	GetFunction() string
	GetFile() string
	GetLine() int
}

type CallerAwareDetail added in v0.5.0

type CallerAwareDetail uint8

type CallerAwareImpl

type CallerAwareImpl struct {
	Function string
	File     string
	Line     int

	Mode   CallerAwareMode
	Detail CallerAwareDetail
}

func (CallerAwareImpl) Get

func (instance CallerAwareImpl) Get() interface{}

func (*CallerAwareImpl) GetFile

func (instance *CallerAwareImpl) GetFile() string

func (*CallerAwareImpl) GetFunction

func (instance *CallerAwareImpl) GetFunction() string

func (*CallerAwareImpl) GetLine

func (instance *CallerAwareImpl) GetLine() int

type CallerAwareMode

type CallerAwareMode uint8

type Factory

type Factory func(event log.Event, callDepth int) Location

func NewCallerAwareFactory added in v0.5.0

func NewCallerAwareFactory(mode CallerAwareMode, detail CallerAwareDetail) Factory

func NewFacade added in v0.5.0

func NewFacade(provider func() Factory) Factory

type Location

type Location interface{}

func NoopFactory

func NoopFactory(log.Event, int) Location

Jump to

Keyboard shortcuts

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