plugin

package
v0.0.0-...-e5bfd07 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomCostPlugin

type CustomCostPlugin struct {
	plugin.Plugin
	// Impl Injection
	Impl CustomCostSource
}

func (CustomCostPlugin) GRPCClient

func (CustomCostPlugin) GRPCClient(context context.Context, b *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

this method is called for as part of the reference plugin implementation see https://github.com/hashicorp/go-plugin/blob/main/examples/basic/shared/greeter_interface.go#L63 for context and details

func (*CustomCostPlugin) GRPCServer

func (p *CustomCostPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

this method is called for as part of the reference plugin implementation see https://github.com/hashicorp/go-plugin/blob/main/examples/basic/shared/greeter_interface.go#L59 for context and details

type CustomCostSource

type CustomCostSource interface {
	GetCustomCosts(req *pb.CustomCostRequest) []*pb.CustomCostResponse
}

plugin interface

type GRPCClient

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

GRPCClient is an implementation of CustomCostsSource that talks over RPC.

func (*GRPCClient) GetCustomCosts

func (m *GRPCClient) GetCustomCosts(req *pb.CustomCostRequest) []*pb.CustomCostResponse

type GRPCServer

type GRPCServer struct {
	pb.UnimplementedCustomCostsSourceServer
	// This is the real implementation
	Impl CustomCostSource
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCServer) GetCustomCosts

func (m *GRPCServer) GetCustomCosts(
	ctx context.Context,
	req *pb.CustomCostRequest) (*pb.CustomCostResponseSet, error)

Jump to

Keyboard shortcuts

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