plugin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package plugin provides several helpers to build a docker log driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	Plugin Plugin
}

HTTPHandler is a helper struct that implements all the http handlers required for a logging driver

func (*HTTPHandler) Capabilities

func (h *HTTPHandler) Capabilities(w http.ResponseWriter, r *http.Request)

Capabilities is an http handler for the /LogDriver.Capabilities endpoint

func (*HTTPHandler) Initialize

func (h *HTTPHandler) Initialize(sh *sdk.Handler)

Initialize assign the handlers to the given sdk handler

func (*HTTPHandler) ReadLogs

func (h *HTTPHandler) ReadLogs(w http.ResponseWriter, r *http.Request)

ReadLogs is an http handler for the /LogDriver.ReadLogs endpoint

func (*HTTPHandler) StartLogging

func (h *HTTPHandler) StartLogging(w http.ResponseWriter, r *http.Request)

StartLogging is an http handler for the /LogDriver.StartLogging endpoint

func (*HTTPHandler) StopLogging

func (h *HTTPHandler) StopLogging(w http.ResponseWriter, r *http.Request)

StopLogging is an http handler for the /LogDriver.StopLogging endpoint

type Plugin

type Plugin interface {
	StartLogging(file string, info logger.Info) error
	StopLogging(file string) error
	Capabilities() logger.Capability
	ReadLogs(info logger.Info, config logger.ReadConfig) (io.ReadCloser, error)
}

Plugin represents the minimal functionality that must be implemented by a logging plugin

func New

func New(validator logger.LogOptValidator, creator logger.Creator) Plugin

New returns a new Plugin

Jump to

Keyboard shortcuts

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