docklog

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MPL-2.0 Imports: 17 Imported by: 65

Documentation

Index

Constants

View Source
const PluginName = "docker_logger"

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerLogger

type DockerLogger interface {
	Start(*StartOpts) error
	Stop() error
}

DockerLogger is a small utility to forward logs from a docker container to a target destination

func LaunchDockerLogger

func LaunchDockerLogger(logger hclog.Logger) (DockerLogger, *plugin.Client, error)

LaunchDockerLogger launches an instance of DockerLogger

func NewDockerLogger

func NewDockerLogger(logger hclog.Logger) DockerLogger

NewDockerLogger returns an implementation of the DockerLogger interface

func ReattachDockerLogger

func ReattachDockerLogger(reattachCfg *plugin.ReattachConfig) (DockerLogger, *plugin.Client, error)

type Plugin

type Plugin struct {
	plugin.NetRPCUnsupportedPlugin
	// contains filtered or unexported fields
}

Plugin is the go-plugin implementation

func NewPlugin

func NewPlugin(impl DockerLogger) *Plugin

func (*Plugin) GRPCClient

func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient returns a client side implementation of the plugin

func (*Plugin) GRPCServer

func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer registered the server side implementation with the grpc server

type StartOpts

type StartOpts struct {
	// Endpoint sets the docker client endpoint, defaults to environment if not set
	Endpoint string

	// ContainerID of the container to monitor logs for
	ContainerID string
	TTY         bool

	// Stdout path to fifo
	Stdout string
	//Stderr path to fifo
	Stderr string

	// StartTime is the Unix time that the docker logger should fetch logs beginning
	// from
	StartTime int64

	// TLS settings for docker client
	TLSCert string
	TLSKey  string
	TLSCA   string
}

StartOpts are the options needed to start docker log monitoring

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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