log

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package log provides a logging middleware for client.

Index

Constants

View Source
const Name = "log"

Name is the middlewares name.

Variables

This section is empty.

Functions

func Provide

func Provide(config map[string]any, _ client.Type, logger log.Logger) (client.Middleware, error)

Provide will be registered to client.Middlewares, it's a factory for this.

Types

type Middleware

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

Middleware is the log Middleware for client.

func (*Middleware) Request added in v0.2.0

Request wraps the original RequestNoCodec method or other middlewares.

func (*Middleware) Start

func (m *Middleware) Start(_ context.Context) error

Start the component. E.g. connect to the broker.

func (*Middleware) Stop

func (m *Middleware) Stop(_ context.Context) error

Stop the component. E.g. disconnect from the broker. The context will contain a timeout, and cancelation should be respected.

func (*Middleware) String

func (m *Middleware) String() string

String returns the name of this middleware.

func (*Middleware) Type

func (m *Middleware) Type() string

Type returns the component type, e.g. broker.

Jump to

Keyboard shortcuts

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