Documentation
¶
Overview ¶
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func DiscoverGoPluginUsing(o *GoPluginLoader) error
- func RegisterGoPluginUsing(loader *GoPluginLoader, name string) error
- func RegisterImplementation(i IPluggable)
- func Serve()
- type GRPCClient
- type GRPCServer
- func (s *GRPCServer) GetEvidence(ctx context.Context, in *compositor.EvidenceIn) (*compositor.EvidenceOut, error)
- func (s *GRPCServer) GetOptions(ctx context.Context, e *emptypb.Empty) (*compositor.OptionsOut, error)
- func (s *GRPCServer) GetSubAttesterID(ctx context.Context, e *emptypb.Empty) (*compositor.SubAttesterIDOut, error)
- func (s *GRPCServer) GetSupportedFormats(ctx context.Context, e *emptypb.Empty) (*compositor.SupportedFormatsOut, error)
- type GoPluginLoader
- type GoPluginManager
- type IManager
- type IPluggable
- type Plugin
- type PluginContext
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("plugin not found")
Functions ¶
func DiscoverGoPluginUsing ¶
func DiscoverGoPluginUsing(o *GoPluginLoader) error
func RegisterGoPluginUsing ¶
func RegisterGoPluginUsing(loader *GoPluginLoader, name string) error
func RegisterImplementation ¶
func RegisterImplementation(i IPluggable)
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func (*GRPCClient) GetEvidence ¶
func (c *GRPCClient) GetEvidence(in *compositor.EvidenceIn) *compositor.EvidenceOut
func (*GRPCClient) GetOptions ¶
func (c *GRPCClient) GetOptions() *compositor.OptionsOut
func (*GRPCClient) GetSubAttesterID ¶
func (c *GRPCClient) GetSubAttesterID() *compositor.SubAttesterIDOut
func (*GRPCClient) GetSupportedFormats ¶
func (c *GRPCClient) GetSupportedFormats() *compositor.SupportedFormatsOut
type GRPCServer ¶
type GRPCServer struct {
compositor.UnimplementedCompositorServer
Impl IPluggable
}
func (*GRPCServer) GetEvidence ¶
func (s *GRPCServer) GetEvidence(ctx context.Context, in *compositor.EvidenceIn) (*compositor.EvidenceOut, error)
func (*GRPCServer) GetOptions ¶
func (s *GRPCServer) GetOptions(ctx context.Context, e *emptypb.Empty) (*compositor.OptionsOut, error)
func (*GRPCServer) GetSubAttesterID ¶
func (s *GRPCServer) GetSubAttesterID(ctx context.Context, e *emptypb.Empty) (*compositor.SubAttesterIDOut, error)
func (*GRPCServer) GetSupportedFormats ¶
func (s *GRPCServer) GetSupportedFormats(ctx context.Context, e *emptypb.Empty) (*compositor.SupportedFormatsOut, error)
type GoPluginLoader ¶
type GoPluginLoader struct {
Location string
// contains filtered or unexported fields
}
func CreateGoPluginLoader ¶
func CreateGoPluginLoader( dir string, logger *zap.SugaredLogger, ) (*GoPluginLoader, error)
func NewGoPluginLoader ¶
func NewGoPluginLoader(logger *zap.SugaredLogger) *GoPluginLoader
func (*GoPluginLoader) Close ¶
func (o *GoPluginLoader) Close()
func (*GoPluginLoader) Init ¶
func (o *GoPluginLoader) Init(dir string) error
func (*GoPluginLoader) SetChecksum ¶
func (o *GoPluginLoader) SetChecksum(v *viper.Viper) error
type GoPluginManager ¶
type GoPluginManager struct {
// contains filtered or unexported fields
}
func CreateGoPluginManager ¶
func CreateGoPluginManager(dir string, logger *zap.SugaredLogger) (*GoPluginManager, error)
func CreateGoPluginManagerWithLoader ¶
func CreateGoPluginManagerWithLoader( loader *GoPluginLoader, logger *zap.SugaredLogger, ) (*GoPluginManager, error)
func NewGoPluginManager ¶
func NewGoPluginManager(loader *GoPluginLoader, logger *zap.SugaredLogger) *GoPluginManager
func (*GoPluginManager) Close ¶
func (o *GoPluginManager) Close() error
func (*GoPluginManager) GetPluginList ¶
func (o *GoPluginManager) GetPluginList() []string
func (*GoPluginManager) Init ¶
func (o *GoPluginManager) Init() error
func (*GoPluginManager) LookupByName ¶
func (o *GoPluginManager) LookupByName(name string) (IPluggable, error)
type IManager ¶
type IManager interface {
// Init initializes the manager, and performing plugin discovery.
Init() error
// Close terminates the manager.
Close() error
// LookupByName returns a handle (implementation of the managed
// interface) to the plugin with the specified name. If there is no
// such plugin, an error is returned.
LookupByName(string) (IPluggable, error)
// GetPluginList returns a []string of the name for the plugins
// that have been registered with the manager by discovered
// plugins.
GetPluginList() []string
}
IManager defines the interface for managing plugins
type IPluggable ¶
type IPluggable interface {
// GetEvidence takes *compositor.EvidenceIn as the input, which contains the nonce
// and one of the content type returned by GetSupportedFormats. It returns a
// *compositor.EvidenceOut that contains the raw evidence for this subattester as
// the output.
GetEvidence(in *compositor.EvidenceIn) *compositor.EvidenceOut
// GetOptions returns a list of attester-specific options user may specify in /chares
GetOptions() *compositor.OptionsOut
// GetSubAttesterID returns a *compositor.SubAttesterIDOut that contains
// the name and the version of the subattesters in field SubAttesterID
GetSubAttesterID() *compositor.SubAttesterIDOut
// GetSupportedFormats returns a *compositor.SupportedFormatsOut that contains
// a list of the output content type and the input nonce sizes supported by this
// sub-attester, accessible in field Formats
GetSupportedFormats() *compositor.SupportedFormatsOut
}
IPluggable respresents a "pluggable" point within Veraison ratsd.
func GetGoPluginHandleByNameUsing ¶
func GetGoPluginHandleByNameUsing(ldr *GoPluginLoader, name string) (IPluggable, error)
type Plugin ¶
type Plugin struct {
plugin.Plugin
Impl IPluggable
}
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, b *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*Plugin) GRPCServer ¶
type PluginContext ¶
type PluginContext struct {
// Path to the exectable binary containing the plugin implementation
Path string
// Name of this plugin
Name string
// Version of this plugin
Version string
// Handle is actual RPC interface to the plugin implementation.
Handle IPluggable
// contains filtered or unexported fields
}
PluginContext is a generic for handling ratsd attesters. It is parameterised on the IPluggable interface it handles.
func (PluginContext) Close ¶
func (o PluginContext) Close()