extension_kit

package module
v1.8.20 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 3 Imported by: 38

README

ExtensionKit logo depicting a wrench within a rounded rectangle on the background

ExtensionKit

Through kits like ActionKit and DiscoveryKit, Steadybit can be extended with new capabilities. Such *Kit usages are called extensions. ExtensionKit contains helpful utilities and best practices for extension authors leveraging the Go programming language.

Installation

Add the following to your go.mod file:

go get github.com/steadybit/extension-kit

Environment Variables

Extension using this extension kit can be configured through environment variables. The following environment variables are supported:

Environment Variable Meaning Default
STEADYBIT_EXTENSION_PORT Overwrite the extensions default port number that the HTTP server should bind to.
STEADYBIT_EXTENSION_HEALTH_PORT Overwrite the extensions default port number that the HTTP server for the health endpoints should bind to.
STEADYBIT_EXTENSION_TLS_SERVER_CERT Optional absolute path to a TLS certificate that will be used to open an HTTPS server.
STEADYBIT_EXTENSION_TLS_SERVER_KEY Optional absolute path to a file containing the key to the server certificate.
STEADYBIT_EXTENSION_TLS_CLIENT_CAS Optional comma-separated list of absolute paths to files containing TLS certificates. When specified, the server will expect clients to authenticate using mutual TLS.
STEADYBIT_EXTENSION_UNIX_SOCKET If set the extension will listen using a unix domain socket instead of tcp.
STEADYBIT_LOG_FORMAT Defines the log format that the extension will use. Possible values are text and json. text
STEADYBIT_LOG_LEVEL Defines the active log level. Possible values are debug, info, warn and error. info
STEADYBIT_LOG_COLOR Defines colorization of log output. Possible values are true, false and unset. If unset will use color only if stderr is a terminal.

Documentation

Overview

Package extension_kit provides utilities to handle extension errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionError

type ExtensionError struct {
	// A human-readable explanation specific to this occurrence of the problem.
	Detail *string `json:"detail,omitempty"`

	// A URI reference that identifies the specific occurrence of the problem.
	Instance *string `json:"instance,omitempty"`

	// A short, human-readable summary of the problem type.
	Title string `json:"title"`

	// A URI reference that identifies the problem type.
	Type *string `json:"type,omitempty"`
}

ExtensionError is a generalization over ActionKit and DiscoveryKit error types. They are structurally identical and can be used interchangeably.

func ToError

func ToError(title string, err error) ExtensionError

ToError converts an error to an ExtensionError.

func WrapError added in v1.8.18

func WrapError(err error) *ExtensionError

WrapError if the error is an ExtensionError, it is returned as is. Otherwise, a new ExtensionError is with the error as title.

func (ExtensionError) Error added in v1.7.4

func (e ExtensionError) Error() string

Directories

Path Synopsis
Package extcmd supports use cases in which a command is supposed be started non-blocking as a result of an incoming HTTP requests, e.g., ActionKit's start call.
Package extcmd supports use cases in which a command is supposed be started non-blocking as a result of an incoming HTTP requests, e.g., ActionKit's start call.
Package exthttp supports setup of HTTP servers to implement the *Kit contracts.
Package exthttp supports setup of HTTP servers to implement the *Kit contracts.
Package extlogging contains general utilities for extension logging.
Package extlogging contains general utilities for extension logging.
Package extutil contains a variety of util functions that were identified as common code duplication.
Package extutil contains a variety of util functions that were identified as common code duplication.

Jump to

Keyboard shortcuts

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