client

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(configType interface{}, opts ...ServeOpt)

Serve is the main entry point for plugins

Types

type AuthenticationPlugin added in v0.3.0

type AuthenticationPlugin interface {
	// Run runs the plugin. The plugin runs until the context is canceled and the server returned
	// by this function is expected to remain functional until then.
	Run(ctx context.Context, config interface{}) (common.AuthenticationPluginServer, error)
}

AuthenticationPlugin adds support for API authentication

type IntegrationPlugin

type IntegrationPlugin interface {
	// Run runs the plugin. Once this function returns the plugin stops running.
	// Implementors must respect the context deadline as that's the signal for graceful shutdown.
	Run(ctx context.Context, config interface{}, srv *Services) error
}

IntegrationPlugin works on the public werft API

type ProxyPassPlugin added in v0.1.1

type ProxyPassPlugin interface {
	Serve(ctx context.Context, l net.Listener) error
}

ProxyPassPlugin adds additional support for proxied webhooks

type RepositoryPlugin added in v0.1.1

type RepositoryPlugin interface {
	// Run runs the plugin. The plugin runs until the context is canceled and the server returned
	// by this function is expected to remain functional until then.
	Run(ctx context.Context, config interface{}) (common.RepositoryPluginServer, error)
}

RepositoryPlugin adds support for a repository host

type ServeOpt

type ServeOpt struct {
	Type common.Type
	Run  func(ctx context.Context, config interface{}, socket string) error
}

ServeOpt configures a plugin serve

func WithAuthenticationPlugin added in v0.3.0

func WithAuthenticationPlugin(p AuthenticationPlugin) ServeOpt

WithRepositoryPlugin registers repo plugin capabilities

func WithIntegrationPlugin

func WithIntegrationPlugin(p IntegrationPlugin) ServeOpt

WithIntegrationPlugin registers integration plugin capabilities

func WithProxyPass added in v0.1.1

func WithProxyPass(p ProxyPassPlugin) ServeOpt

WithProxyPass enables a "through werft" proxy route to the plugin. The route will be available at "http://<werft-location>/plugins/<plugin-name>"

func WithRepositoryPlugin added in v0.1.1

func WithRepositoryPlugin(p RepositoryPlugin) ServeOpt

WithRepositoryPlugin registers repo plugin capabilities

type Services added in v0.2.0

type Services struct {
	v1.WerftServiceClient
	v1.WerftUIClient
}

Jump to

Keyboard shortcuts

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