Documentation ¶
Index ¶
- Constants
- Variables
- func Serve(t oplugin.DependencyResolverMod, logger hclog.Logger)
- type Connector
- type GRPCClient
- func (m *GRPCClient) CompileAssets(ctx context.Context, request plugin.CompileAssetsRequest) (*plugin.CompileAssetsResponse, error)
- func (m *GRPCClient) GenerateDependencies(ctx context.Context, request plugin.GenerateDependenciesRequest) (*plugin.GenerateDependenciesResponse, error)
- func (m *GRPCClient) GenerateDestination(ctx context.Context, request plugin.GenerateDestinationRequest) (*plugin.GenerateDestinationResponse, error)
- func (m *GRPCClient) GetName(ctx context.Context) (string, error)
- type GRPCServer
- func (s *GRPCServer) CompileAssets(ctx context.Context, req *pbp.CompileAssetsRequest) (*pbp.CompileAssetsResponse, error)
- func (s *GRPCServer) GenerateDependencies(ctx context.Context, req *pbp.GenerateDependenciesRequest) (*pbp.GenerateDependenciesResponse, error)
- func (s *GRPCServer) GenerateDestination(ctx context.Context, req *pbp.GenerateDestinationRequest) (*pbp.GenerateDestinationResponse, error)
- func (s *GRPCServer) GetName(ctx context.Context, _ *pbp.GetNameRequest) (*pbp.GetNameResponse, error)
Constants ¶
View Source
const ( PluginGRPCMaxRetry = 3 BackoffDuration = 200 * time.Millisecond )
Variables ¶
View Source
var ( // Handshake is used to just do a basic Handshake between // a plugin and host. If the Handshake fails, a user friendly error is shown. // This prevents users from executing bad plugins or executing a plugin // directory. It is a UX feature, not a security feature. Handshake = hplugin.HandshakeConfig{ ProtocolVersion: protocolVersion, MagicCookieKey: magicCookieKey, MagicCookieValue: magicCookieValue, } )
Functions ¶
func Serve ¶
func Serve(t oplugin.DependencyResolverMod, logger hclog.Logger)
Types ¶
type Connector ¶
type Connector struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin // contains filtered or unexported fields }
func NewPlugin ¶
func NewPlugin(impl oplugin.DependencyResolverMod, logger hclog.Logger) *Connector
func NewPluginClient ¶
func NewPluginClient(logger hclog.Logger) *Connector
func (*Connector) GRPCClient ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient will be used by core to talk over grpc with plugins
func (*GRPCClient) CompileAssets ¶
func (m *GRPCClient) CompileAssets(ctx context.Context, request plugin.CompileAssetsRequest) (*plugin.CompileAssetsResponse, error)
func (*GRPCClient) GenerateDependencies ¶
func (m *GRPCClient) GenerateDependencies(ctx context.Context, request plugin.GenerateDependenciesRequest) (*plugin.GenerateDependenciesResponse, error)
func (*GRPCClient) GenerateDestination ¶
func (m *GRPCClient) GenerateDestination(ctx context.Context, request plugin.GenerateDestinationRequest) (*plugin.GenerateDestinationResponse, error)
type GRPCServer ¶
type GRPCServer struct { // This is the real implementation coming from plugin Impl plugin.DependencyResolverMod pbp.UnimplementedDependencyResolverModServiceServer }
GRPCServer will be used by plugins this is working as proto adapter
func (*GRPCServer) CompileAssets ¶
func (s *GRPCServer) CompileAssets(ctx context.Context, req *pbp.CompileAssetsRequest) (*pbp.CompileAssetsResponse, error)
func (*GRPCServer) GenerateDependencies ¶
func (s *GRPCServer) GenerateDependencies(ctx context.Context, req *pbp.GenerateDependenciesRequest) (*pbp.GenerateDependenciesResponse, error)
func (*GRPCServer) GenerateDestination ¶
func (s *GRPCServer) GenerateDestination(ctx context.Context, req *pbp.GenerateDestinationRequest) (*pbp.GenerateDestinationResponse, error)
func (*GRPCServer) GetName ¶
func (s *GRPCServer) GetName(ctx context.Context, _ *pbp.GetNameRequest) (*pbp.GetNameResponse, error)
Click to show internal directories.
Click to hide internal directories.