sink

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.

Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.

Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.

Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.

Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.

Index

Constants

View Source
const (
	ExitOnWarningEnv string = "CONNTRACKD_SINK_EXIT_ON_WARNING"
)

Variables

View Source
var LokiProtocols = []string{"http", "https"}
View Source
var StreamWriters = []string{"stdout", "stderr", "discard"}
View Source
var SyslogProtocols = []string{"udp", "tcp", "unix", "unixgram", "unixpacket"}

Functions

This section is empty.

Types

type Config added in v1.0.0

type Config struct {
	Journal Journal
	Syslog  Syslog
	Loki    Loki
	Stream  Stream
}

type Journal

type Journal struct {
	Enable bool
}

func (*Journal) TargetJournal

func (j *Journal) TargetJournal(options *slog.HandlerOptions) (slog.Handler, error)

type Loki

type Loki struct {
	Enable  bool
	Address string
	Labels  []string
}

func (*Loki) TargetLoki

func (l *Loki) TargetLoki(options *slog.HandlerOptions) (slog.Handler, error)

type Sink

type Sink struct {
	Logger *slog.Logger
}

func NewSink added in v1.0.0

func NewSink(config *Config) (*Sink, error)

type SinkTarget

type SinkTarget func(*slog.HandlerOptions) (slog.Handler, error)

type Stream added in v0.2.0

type Stream struct {
	Enable bool
	Writer string
}

func (*Stream) TargetStream added in v0.2.0

func (s *Stream) TargetStream(options *slog.HandlerOptions) (slog.Handler, error)

type Syslog

type Syslog struct {
	Enable  bool
	Address string
}

func (*Syslog) TargetSyslog

func (s *Syslog) TargetSyslog(options *slog.HandlerOptions) (slog.Handler, error)

Jump to

Keyboard shortcuts

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