system

package
v1.509.25 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

Plugin System

The Aspect CLI has a plugin system that allows engineers to easily build features on top of Bazel.

Glossary

  • Aspect CLI Core, or simply Core, refers to the core system of the CLI that holds the control over the lifecycle of Plugin instances.
  • Plugin instance, or sometimes just Plugin, refers to a binary application that uses this SDK to extend the functionality of the Core.
  • Plugin maintainer refers to a person that maintains a Plugin implementation.
  • Aspect CLI SDK refers to the development kit that abstracts away all the complexity of implementing a Plugin for the Core.

Overview

The Core exposes 2 integration categories for Plugins:

  1. The Build Event Protocol (BEP).
  2. Hooks for the lifecycle of the Core.

Integration categories

The Build Event Protocol (BEP)

The BEP is documented here. Plugins can listen to the BEP events in real-time. The Core intercepts all the events from Bazel using the exposed gRPC Build Event Service and re-constructing the original BEP events. The Core, then, forwards each event to the Plugins.

Hooks

The Core exposes multiple hook points that can be easily accessed when implementing Plugins with the SDK. See each SDK documentation for more details on which hooks are exposed.

Current SDK

See the current SDK README.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginList

type PluginList struct {
	// contains filtered or unexported fields
}

PluginList implements a simple linked list for the parsed plugins from the plugins file.

type PluginNode

type PluginNode struct {
	// contains filtered or unexported fields
}

PluginNode is a node in the PluginList linked list.

type PluginSystem

type PluginSystem interface {
	Configure(streams ioutils.Streams, pluginsConfig interface{}) error
	TearDown()
	RegisterCustomCommands(cmd *cobra.Command, bazelStartupArgs []string) error
	BESBackendInterceptor() interceptors.Interceptor
	BESBackendSubscriberInterceptor() interceptors.Interceptor
	BuildHooksInterceptor(streams ioutils.Streams) interceptors.Interceptor
	TestHooksInterceptor(streams ioutils.Streams) interceptors.Interceptor
	RunHooksInterceptor(streams ioutils.Streams) interceptors.Interceptor
}

PluginSystem is the interface that defines all the methods for the aspect CLI plugin system intended to be used by the Core.

func NewPluginSystem

func NewPluginSystem() PluginSystem

NewPluginSystem instantiates a default internal implementation of the PluginSystem interface.

Directories

Path Synopsis
bep
mock
Package mock contains generated files.
Package mock contains generated files.
mock
Package mock contains generated files.
Package mock contains generated files.
Package mock contains generated files.
Package mock contains generated files.

Jump to

Keyboard shortcuts

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