json

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package json defines the logging JSON formatter and JSON formatter creation strategy to be integrated into the logging package formatter factory instance.

Index

Constants

View Source
const (
	// Format defines the value to be used to declare a
	// JSON Log formatter format.
	Format = "json"
)
View Source
const (
	// ID defines the application container registration string for the
	// logging JSON formatter strategy.
	ID = formatter.ID + ".json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct{}

Formatter defines an instance used to format a log message into a JSON string.

func (Formatter) Format

func (f Formatter) Format(
	level log.Level,
	message string,
	ctx ...log.Context,
) string

Format will create the output JSON string message formatted with the content of the passed level, message and context

type FormatterStrategy

type FormatterStrategy struct{}

FormatterStrategy defines a log message JSON formatter generation strategy.

func NewFormatterStrategy

func NewFormatterStrategy() *FormatterStrategy

NewFormatterStrategy generates a new JSON formatter generation strategy instance.

func (FormatterStrategy) Accept

func (FormatterStrategy) Accept(
	format string,
) bool

Accept will check if the formatter factory strategy can instantiate a formatter of the requested format.

func (FormatterStrategy) Create

func (FormatterStrategy) Create(
	_ ...interface{},
) (log.IFormatter, error)

Create will instantiate the desired formatter instance.

type Provider

type Provider struct{}

Provider defines the slate.config module service provider to be used on the application initialization to register the config service.

func (Provider) Boot

func (p Provider) Boot(
	container slate.IContainer,
) error

Boot will start the configuration config instance by calling the configuration loader with the defined provider base entry information.

func (Provider) Register

func (Provider) Register(
	container slate.IContainer,
) error

Register will register the configuration section instances in the application container.

Jump to

Keyboard shortcuts

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