model

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Bucket1 ...
	Bucket1 = iota
	// Bucket2 ...
	Bucket2
	// Bucket3 ...
	Bucket3
	// Bucket4 ...
	Bucket4
	// Bucket5 ...
	Bucket5
	// Bucket6 ...
	Bucket6
	// Bucket7 ...
	Bucket7
	// Bucket8 ...
	Bucket8
)
View Source
const BucketMax = Bucket8

BucketMax ...

View Source
const HumanTimeFormat = "human"

HumanTimeFormat ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action a action name.

type Application

type Application string

Application the name of an application.

type CodeLocation added in v1.1.0

type CodeLocation string

CodeLocation ...

func (CodeLocation) Mark added in v1.1.0

func (cl CodeLocation) Mark(category string)

Mark ...

type Context

type Context string

Context a context name.

func (Context) String

func (contextName Context) String() string

String ...

type Entity

type Entity string

Entity a entity name.

func (Entity) Abbreviate

func (c Entity) Abbreviate(maxWidth int) Entity

Abbreviate ...

type Error

type Error Message

Error a stack trace.

type Event

type Event struct {
	// Timestamp the timestamp. This field is required, and should default to time.Now() if not present.
	Timestamp Timestamp `json:"timestamp" regroup:"timestamp"`
	// Level the level. This field is required, and should default to Info if not present.
	Level level.Level `json:"level" regroup:"level"`
	// Message the message. This field is required.
	Message Message `json:"message" regroup:"message"`
	// Application is the name of the application that generated this event. This field is optional.
	Application Application `json:"application" regroup:"application"`
	// Action the action name. This field is optional.
	Action Action `json:"action" regroup:"action"`
	// Line the line number. This field is optional.
	Line Line `json:"line" regroup:"line"`
	// Context the context name. This field is optional.
	Context Context `json:"context" regroup:"context"`
	// Entity the entity name. This field is optional.
	Entity Entity `json:"entity" regroup:"entity"`
	// Error the error. This field is optional.
	Error Error `json:"error" regroup:"error"`
}

Event a log event

func (Event) AsCodeLocation added in v1.1.0

func (event Event) AsCodeLocation() CodeLocation

AsCodeLocation ...

type Filter

type Filter struct {
	Pattern regexp.Regexp
	Kind    FilterKind
}

Filter ...

type FilterKind

type FilterKind int

FilterKind ...

const (

	// Exclude ...
	Exclude FilterKind
	// AlertOnce ...
	AlertOnce
	// Include ...
	Include
)

type Line

type Line uint64

Line a line number.

const (
	// NoLineNumber indicates no line number is present.
	NoLineNumber Line = 0
)

func (*Line) UnmarshalJSON

func (l *Line) UnmarshalJSON(bytes []byte) error

UnmarshalJSON ...

type Manager

type Manager interface {
	// Run ...
	Run() error
	// Start the Manager.
	Start() error
	// Stop the Manager.
	Stop()
	// Wait for the manager to stop.
	Wait()
	// Register one or more sinks or registry.
	Register(opts ...interface{}) error
	// TrapSignals ...
	TrapSignals()
}

Manager manages the lifecycle of registry, and the routing of their events to the sinks.

type Message

type Message string

Message a message.

func (Message) Matches

func (msg Message) Matches(filters *[]Filter) FilterKind

Matches determines if an event Matches the filters criteria.

func (Message) String

func (msg Message) String() string

String ...

type SinkEvent

type SinkEvent struct {
	Event
	SourceURL SourceURL
	Filters   filters
	Schema    *schema.Schema
}

SinkEvent ...

func (SinkEvent) LevelMeterBucket added in v1.1.0

func (event SinkEvent) LevelMeterBucket() uint8

LevelMeterBucket ...

type SourceURL

type SourceURL url.URL

SourceURL ...

func (SourceURL) Hash

func (u SourceURL) Hash() int

Hash ...

func (SourceURL) HashString

func (u SourceURL) HashString() string

HashString ...

func (*SourceURL) Normalize

func (u *SourceURL) Normalize()

Normalize fixes situations where scheme://some/path/list is given rather than scheme:///some/path/list. In the first case this results in a hostname of some and a path of /path/list. This action rewrites it into the proper second form.

func (*SourceURL) QueryFlag

func (u *SourceURL) QueryFlag(key string) bool

QueryFlag looks up a QueryKey parameter value. If the key exists with an empty value, it is the equivalent of having set the value to true.

func (*SourceURL) QueryInt64

func (u *SourceURL) QueryInt64(key string) (*int64, error)

QueryInt64 returns the value of the QueryKey parameter a pointer to an int64. If the parameter is not set, or is set to empty, a nil pointer with no error is returned.

func (*SourceURL) QueryKey

func (u *SourceURL) QueryKey(key string) (string, bool)

QueryKey looks up a QueryKey parameter value.

func (SourceURL) ShortForm

func (u SourceURL) ShortForm() string

ShortForm ...

func (SourceURL) String

func (u SourceURL) String() string

String ...

type Timestamp

type Timestamp time.Time

Timestamp When the even occurred.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(bytes []byte) error

UnmarshalJSON ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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