bundler

package
v0.0.0-...-b764b01 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unbundler

type Unbundler interface {
	Unbundle(path string) string
}

Greeter is the interface that we're exposing as a plugin.

type UnbundlerPlugin

type UnbundlerPlugin struct {
	// Impl Injection
	Impl Unbundler
}

This 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 GreeterRPCServer for this.

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

Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.

func (UnbundlerPlugin) Client

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

func (*UnbundlerPlugin) Server

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

type UnbundlerRPC

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

Here is an implementation that talks over RPC

func (*UnbundlerRPC) Unbundle

func (g *UnbundlerRPC) Unbundle(path string) string

type UnbundlerRPCServer

type UnbundlerRPCServer struct {
	// This is the real implementation
	Impl Unbundler
}

Here is the RPC server that GreeterRPC talks to, conforming to the requirements of net/rpc

func (*UnbundlerRPCServer) Unbundle

func (s *UnbundlerRPCServer) Unbundle(path string, resp *string) error

Jump to

Keyboard shortcuts

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