client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 14 Imported by: 5

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

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 Bhojpur Piro API

type ProxyPassPlugin

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

ProxyPassPlugin adds additional support for proxied webhooks

type RepositoryPlugin

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

func WithAuthenticationPlugin(p AuthenticationPlugin) ServeOpt

WithRepositoryPlugin registers repo plugin capabilities

func WithIntegrationPlugin

func WithIntegrationPlugin(p IntegrationPlugin) ServeOpt

WithIntegrationPlugin registers integration plugin capabilities

func WithProxyPass

func WithProxyPass(p ProxyPassPlugin) ServeOpt

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

func WithRepositoryPlugin

func WithRepositoryPlugin(p RepositoryPlugin) ServeOpt

WithRepositoryPlugin registers repo plugin capabilities

type Services

type Services struct {
	v1.PiroServiceClient
	v1.PiroUIClient
}

Jump to

Keyboard shortcuts

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