application

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This defines the default api root for incoming
	// log messages.
	API_ROOT_PATH = "/api/v1/logbooks"

	// seize of buffer for channels
	CHANNEL_BUFFER = 20

	NUMBER_OF_DISPATCHERS = 1
)
View Source
const (
	LogHeaderPrefix        string = "LogBook"
	LogHeaderAppIdentifier string = LogHeaderPrefix + "-App-Identifier"
	LogHeaderLoggerName    string = LogHeaderPrefix + "-Logger-Name"
	LogHeaderRequestUri    string = LogHeaderPrefix + "-Request-URI"
	LogHeaderRequestId     string = LogHeaderPrefix + "-Request-Id"
)

Variables

This section is empty.

Functions

func ForceCookie

func ForceCookie(c *gin.Context, id string)

Types

type HeaderData

type HeaderData struct {
	Application string
	LoggerName  string
	RequestUri  string
	RequestId   string
}

Header data contain information about the origin of the message, like app and logger or the request uri

type IncomingMessage

type IncomingMessage struct {
	Body   LogMessageBody
	Origin HeaderData
	// contains filtered or unexported fields
}

This the data structure for incoming messages. It consists of header data and the information in the http body.

Here our ontology is oriented at the technical prospective of http-requests

type LogBookApplication

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

This is the main backend application It contains the inbox and dispatcher and manages the processing of incoming log messages

func (*LogBookApplication) AddApplicationToEngine

func (app *LogBookApplication) AddApplicationToEngine(engine *gin.Engine)

Use this function to register the LogBookAppliccation to a given GIN-engine. It will

* initialize inbox and dispatcher, * start the log inbox, and * start the LogBook API

type LogBookEntry

type LogBookEntry struct {
	Application  string `json:"application"`
	LoggerName   string `json:"logger"`
	RequestUri   string `json:"request_uri"`
	RequestId    string `json:"request_id"`
	Timestamp    int    `json:"time"`
	Message      string `json:"message"`
	Severity     int    `json:"severity"`
	SeverityText string `json:"severity_text"`

	// The Context will be eliminated in a future version
	// because it only affects the working of psr-compatible
	// loggers in PHP
	Context interface{} `json:"context"`
	// contains filtered or unexported fields
}

The LogBook-entry is the transformed data object which contains data for the LogBook frontend.

Here we use the genuine LogBook-ontology

type LogMessageBody

type LogMessageBody struct {
	Timestamp int         `json:"time"`
	Message   string      `json:"message"`
	Severity  interface{} `json:"severity"`

	// The context is not a natural part of
	// a log message in general, but only for
	// psr-loggers in PHP. This should therefore
	// be eliminated in the future
	Context interface{} `json:"context"`
}

The body of the message is sent as a json object

Jump to

Keyboard shortcuts

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