plugin

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{

	ProtocolVersion:  1,
	MagicCookieKey:   "UNIRTM_PLUGIN",
	MagicCookieValue: "hello",
}

HandshakeConfig is a common handshake that is shared by plugin and host.

View Source
var PluginMap = map[string]plugin.Plugin{
	"backend":  &BackendPlugin{},
	"provider": &ProviderPlugin{},
}

Map is the map of plugins we can dispense.

Functions

This section is empty.

Types

type BackendPlugin

type BackendPlugin struct {
	Impl backend.Backend
}

BackendPlugin is the implementation of plugin.Plugin so we can serve/consume this

This has two methods: Server must return an RPC server for this plugin type. We construct a BackendRPCServer for this.

Client must return an implementation of our interface that communicates over an RPC client. We return BackendRPCClient for this.

func (BackendPlugin) Client

func (BackendPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*BackendPlugin) Server

func (p *BackendPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type BackendRPCClient

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

BackendRPCClient is an implementation of backend.Backend that talks over RPC.

func (*BackendRPCClient) AttestationType added in v0.2.0

func (m *BackendRPCClient) AttestationType() string

func (*BackendRPCClient) Dependencies added in v0.2.0

func (m *BackendRPCClient) Dependencies() []string

func (*BackendRPCClient) GetDownloadInfo

func (m *BackendRPCClient) GetDownloadInfo(ctx context.Context, tool string, version string, platform backend.Platform) (*backend.VersionInfo, error)

func (*BackendRPCClient) GetReach added in v0.2.0

func (m *BackendRPCClient) GetReach() string

func (*BackendRPCClient) IsRecommended added in v0.2.0

func (m *BackendRPCClient) IsRecommended() bool

func (*BackendRPCClient) IsScriptless added in v0.2.0

func (m *BackendRPCClient) IsScriptless() bool

func (*BackendRPCClient) IsStable added in v0.2.0

func (m *BackendRPCClient) IsStable() bool

func (*BackendRPCClient) ListVersions

func (m *BackendRPCClient) ListVersions(ctx context.Context, tool string, platform backend.Platform) ([]backend.VersionInfo, error)

func (*BackendRPCClient) Name

func (m *BackendRPCClient) Name() string

func (*BackendRPCClient) ResolveVersion

func (m *BackendRPCClient) ResolveVersion(ctx context.Context, tool string, versionRequest string, platform backend.Platform) (*backend.VersionInfo, error)

func (*BackendRPCClient) SupportsChecksum

func (m *BackendRPCClient) SupportsChecksum() bool

func (*BackendRPCClient) SupportsGPG

func (m *BackendRPCClient) SupportsGPG() bool

func (*BackendRPCClient) SupportsOffline added in v0.2.0

func (m *BackendRPCClient) SupportsOffline() bool

type BackendRPCServer

type BackendRPCServer struct {
	// This is the real implementation
	Impl backend.Backend
}

BackendRPCServer is the RPC server that BackendRPCClient talks to, conforming to the requirements of net/rpc.

func (*BackendRPCServer) AttestationType added in v0.2.0

func (s *BackendRPCServer) AttestationType(args interface{}, resp *string) error

func (*BackendRPCServer) Dependencies added in v0.2.0

func (s *BackendRPCServer) Dependencies(args interface{}, resp *[]string) error

func (*BackendRPCServer) GetDownloadInfo

func (s *BackendRPCServer) GetDownloadInfo(args GetDownloadInfoArgs, resp *backend.VersionInfo) error

func (*BackendRPCServer) GetReach added in v0.2.0

func (s *BackendRPCServer) GetReach(args interface{}, resp *string) error

func (*BackendRPCServer) IsRecommended added in v0.2.0

func (s *BackendRPCServer) IsRecommended(args interface{}, resp *bool) error

func (*BackendRPCServer) IsScriptless added in v0.2.0

func (s *BackendRPCServer) IsScriptless(args interface{}, resp *bool) error

func (*BackendRPCServer) IsStable added in v0.2.0

func (s *BackendRPCServer) IsStable(args interface{}, resp *bool) error

func (*BackendRPCServer) ListVersions

func (s *BackendRPCServer) ListVersions(args ListVersionsArgs, resp *[]backend.VersionInfo) error

func (*BackendRPCServer) Name

func (s *BackendRPCServer) Name(args interface{}, resp *string) error

func (*BackendRPCServer) ResolveVersion

func (s *BackendRPCServer) ResolveVersion(args ResolveVersionArgs, resp *backend.VersionInfo) error

func (*BackendRPCServer) SupportsChecksum

func (s *BackendRPCServer) SupportsChecksum(args interface{}, resp *bool) error

func (*BackendRPCServer) SupportsGPG

func (s *BackendRPCServer) SupportsGPG(args interface{}, resp *bool) error

func (*BackendRPCServer) SupportsOffline added in v0.2.0

func (s *BackendRPCServer) SupportsOffline(args interface{}, resp *bool) error

type DetectVersionArgs

type DetectVersionArgs struct {
	Tool        string
	InstallPath string
}

type GenerateShimsArgs

type GenerateShimsArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

type GetBinPathsArgs

type GetBinPathsArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

type GetDownloadInfoArgs

type GetDownloadInfoArgs struct {
	Tool     string
	Version  string
	Platform backend.Platform
}

GetDownloadInfoArgs represents arguments for GetDownloadInfo.

type GetEnvVarsArgs

type GetEnvVarsArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

type InstallArgs

type InstallArgs struct {
	Tool         string
	InstallPath  string
	ArtifactPath string
	Version      string
}

type ListExecutablesArgs

type ListExecutablesArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

type ListVersionsArgs

type ListVersionsArgs struct {
	Tool     string
	Platform backend.Platform
}

ListVersionsArgs represents arguments for ListVersions.

type PostInstallArgs

type PostInstallArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

type ProviderPlugin

type ProviderPlugin struct {
	Impl provider.Provider
}

ProviderPlugin is the implementation of plugin.Plugin so we can serve/consume this

func (ProviderPlugin) Client

func (ProviderPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ProviderPlugin) Server

func (p *ProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type ProviderRPCClient

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

ProviderRPCClient is an implementation of provider.Provider that talks over RPC.

func (*ProviderRPCClient) DetectVersion

func (m *ProviderRPCClient) DetectVersion(ctx context.Context, tool string, installPath string) (string, error)

func (*ProviderRPCClient) GenerateShims

func (m *ProviderRPCClient) GenerateShims(tool string, installPath string, version string) (map[string]string, error)

func (*ProviderRPCClient) GetBinPaths

func (m *ProviderRPCClient) GetBinPaths(tool string, installPath string, version string) ([]string, error)

func (*ProviderRPCClient) GetEnvVars

func (m *ProviderRPCClient) GetEnvVars(tool string, installPath string, version string) (map[string]string, error)

func (*ProviderRPCClient) Install

func (m *ProviderRPCClient) Install(ctx context.Context, tool string, installPath string, artifactPath string, version string) error

func (*ProviderRPCClient) ListExecutables

func (m *ProviderRPCClient) ListExecutables(tool string, installPath string, version string) ([]string, error)

func (*ProviderRPCClient) Name

func (m *ProviderRPCClient) Name() string

func (*ProviderRPCClient) PostInstall

func (m *ProviderRPCClient) PostInstall(ctx context.Context, tool string, installPath string, version string) error

func (*ProviderRPCClient) Uninstall

func (m *ProviderRPCClient) Uninstall(ctx context.Context, tool string, installPath string, version string) error

type ProviderRPCServer

type ProviderRPCServer struct {
	Impl provider.Provider
}

ProviderRPCServer is the RPC server that ProviderRPCClient talks to, conforming to the requirements of net/rpc.

func (*ProviderRPCServer) DetectVersion

func (s *ProviderRPCServer) DetectVersion(args DetectVersionArgs, resp *string) error

func (*ProviderRPCServer) GenerateShims

func (s *ProviderRPCServer) GenerateShims(args GenerateShimsArgs, resp *map[string]string) error

func (*ProviderRPCServer) GetBinPaths

func (s *ProviderRPCServer) GetBinPaths(args GetBinPathsArgs, resp *[]string) error

func (*ProviderRPCServer) GetEnvVars

func (s *ProviderRPCServer) GetEnvVars(args GetEnvVarsArgs, resp *map[string]string) error

func (*ProviderRPCServer) Install

func (s *ProviderRPCServer) Install(args InstallArgs, resp *struct{}) error

func (*ProviderRPCServer) ListExecutables

func (s *ProviderRPCServer) ListExecutables(args ListExecutablesArgs, resp *[]string) error

func (*ProviderRPCServer) Name

func (s *ProviderRPCServer) Name(args interface{}, resp *string) error

func (*ProviderRPCServer) PostInstall

func (s *ProviderRPCServer) PostInstall(args PostInstallArgs, resp *struct{}) error

func (*ProviderRPCServer) Uninstall

func (s *ProviderRPCServer) Uninstall(args UninstallArgs, resp *struct{}) error

type ResolveVersionArgs

type ResolveVersionArgs struct {
	Tool           string
	VersionRequest string
	Platform       backend.Platform
}

ResolveVersionArgs represents arguments for ResolveVersion.

type UninstallArgs

type UninstallArgs struct {
	Tool        string
	InstallPath string
	Version     string
}

Jump to

Keyboard shortcuts

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