Documentation
¶
Index ¶
- Constants
- Variables
- func GetPluginDir() (string, error)
- func GetPluginPath(name string) (string, error)
- func IsDataSourceServeCmd(args []string) bool
- func PluginExists(name string) (bool, error)
- type CliPlugin
- type DataSource
- type DataSourcePlugin
- type DataSourcePluginClientGRPC
- func (c *DataSourcePluginClientGRPC) AddAPBinding(*ap_binding_proto.APBinding) (*ap_binding_proto.APBinding, error)
- func (c *DataSourcePluginClientGRPC) AddAttestationPolicy(*attestation_policy_proto.AttestationPolicy) (*attestation_policy_proto.AttestationPolicy, error)
- func (c *DataSourcePluginClientGRPC) AddFederation(*federation_proto.Federation) (*federation_proto.Federation, error)
- func (c *DataSourcePluginClientGRPC) AddTrustZone(trustZone *trust_zone_proto.TrustZone) (*trust_zone_proto.TrustZone, error)
- func (c *DataSourcePluginClientGRPC) DestroyAPBinding(*ap_binding_proto.APBinding) error
- func (c *DataSourcePluginClientGRPC) GetAttestationPolicy(string) (*attestation_policy_proto.AttestationPolicy, error)
- func (c *DataSourcePluginClientGRPC) GetTrustZone(name string) (*trust_zone_proto.TrustZone, error)
- func (c *DataSourcePluginClientGRPC) ListAttestationPolicies() ([]*attestation_policy_proto.AttestationPolicy, error)
- func (c *DataSourcePluginClientGRPC) ListFederations() ([]*federation_proto.Federation, error)
- func (c *DataSourcePluginClientGRPC) ListFederationsByTrustZone(string) ([]*federation_proto.Federation, error)
- func (c *DataSourcePluginClientGRPC) ListTrustZones() ([]*trust_zone_proto.TrustZone, error)
- func (c *DataSourcePluginClientGRPC) UpdateTrustZone(*trust_zone_proto.TrustZone) error
- func (c *DataSourcePluginClientGRPC) Validate() error
- type GRPCServer
Constants ¶
const DataSourcePluginName = "data_source"
DataSourcePluginName is the name that should be used in the plugin map.
Variables ¶
var DataSourcePluginArgs []string = []string{"data-source", "serve"}
DataSourcePluginArgs contains the arguments passed to plugins when executing them as a data source.
var HandshakeConfig = go_plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "COFIDECTL_PLUGIN",
MagicCookieValue: "config",
}
HandshakeConfig is a common handshake that is shared by plugin and host.
Functions ¶
func GetPluginDir ¶
func GetPluginPath ¶
func IsDataSourceServeCmd ¶
IsDataSourceServeCmd returns whether the provided command line arguments indicate that a plugin should serve a data source.
func PluginExists ¶
Types ¶
type CliPlugin ¶
func NewCliPlugin ¶
type DataSource ¶
type DataSource interface { Validate() error GetTrustZone(string) (*trust_zone_proto.TrustZone, error) ListTrustZones() ([]*trust_zone_proto.TrustZone, error) AddTrustZone(*trust_zone_proto.TrustZone) (*trust_zone_proto.TrustZone, error) UpdateTrustZone(*trust_zone_proto.TrustZone) error AddAttestationPolicy(*attestation_policy_proto.AttestationPolicy) (*attestation_policy_proto.AttestationPolicy, error) GetAttestationPolicy(string) (*attestation_policy_proto.AttestationPolicy, error) ListAttestationPolicies() ([]*attestation_policy_proto.AttestationPolicy, error) AddAPBinding(*ap_binding_proto.APBinding) (*ap_binding_proto.APBinding, error) DestroyAPBinding(*ap_binding_proto.APBinding) error AddFederation(*federation_proto.Federation) (*federation_proto.Federation, error) ListFederations() ([]*federation_proto.Federation, error) ListFederationsByTrustZone(string) ([]*federation_proto.Federation, error) }
DataSource is the interface plugins have to implement.
type DataSourcePlugin ¶
type DataSourcePlugin struct { go_plugin.Plugin Impl DataSource }
DataSourcePlugin implements the plugin.Plugin interface to provide the GRPC server or client back to the plugin machinery. The server side should proved the Impl field with a concrete implementation of the DataSource interface.
func (*DataSourcePlugin) GRPCClient ¶
func (dsp *DataSourcePlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*DataSourcePlugin) GRPCServer ¶
func (dsp *DataSourcePlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error
type DataSourcePluginClientGRPC ¶
type DataSourcePluginClientGRPC struct {
// contains filtered or unexported fields
}
DataSourcePluginClientGRPC is used by clients (main application) to translate the DataSource interface of plugins to GRPC calls.
func (*DataSourcePluginClientGRPC) AddAPBinding ¶
func (c *DataSourcePluginClientGRPC) AddAPBinding(*ap_binding_proto.APBinding) (*ap_binding_proto.APBinding, error)
func (*DataSourcePluginClientGRPC) AddAttestationPolicy ¶
func (c *DataSourcePluginClientGRPC) AddAttestationPolicy(*attestation_policy_proto.AttestationPolicy) (*attestation_policy_proto.AttestationPolicy, error)
func (*DataSourcePluginClientGRPC) AddFederation ¶
func (c *DataSourcePluginClientGRPC) AddFederation(*federation_proto.Federation) (*federation_proto.Federation, error)
func (*DataSourcePluginClientGRPC) AddTrustZone ¶
func (c *DataSourcePluginClientGRPC) AddTrustZone(trustZone *trust_zone_proto.TrustZone) (*trust_zone_proto.TrustZone, error)
func (*DataSourcePluginClientGRPC) DestroyAPBinding ¶
func (c *DataSourcePluginClientGRPC) DestroyAPBinding(*ap_binding_proto.APBinding) error
func (*DataSourcePluginClientGRPC) GetAttestationPolicy ¶
func (c *DataSourcePluginClientGRPC) GetAttestationPolicy(string) (*attestation_policy_proto.AttestationPolicy, error)
func (*DataSourcePluginClientGRPC) GetTrustZone ¶
func (c *DataSourcePluginClientGRPC) GetTrustZone(name string) (*trust_zone_proto.TrustZone, error)
func (*DataSourcePluginClientGRPC) ListAttestationPolicies ¶
func (c *DataSourcePluginClientGRPC) ListAttestationPolicies() ([]*attestation_policy_proto.AttestationPolicy, error)
func (*DataSourcePluginClientGRPC) ListFederations ¶
func (c *DataSourcePluginClientGRPC) ListFederations() ([]*federation_proto.Federation, error)
func (*DataSourcePluginClientGRPC) ListFederationsByTrustZone ¶
func (c *DataSourcePluginClientGRPC) ListFederationsByTrustZone(string) ([]*federation_proto.Federation, error)
func (*DataSourcePluginClientGRPC) ListTrustZones ¶
func (c *DataSourcePluginClientGRPC) ListTrustZones() ([]*trust_zone_proto.TrustZone, error)
func (*DataSourcePluginClientGRPC) UpdateTrustZone ¶
func (c *DataSourcePluginClientGRPC) UpdateTrustZone(*trust_zone_proto.TrustZone) error
func (*DataSourcePluginClientGRPC) Validate ¶
func (c *DataSourcePluginClientGRPC) Validate() error
type GRPCServer ¶
type GRPCServer struct {
Impl DataSource
}
func (*GRPCServer) ListTrustZones ¶
func (s *GRPCServer) ListTrustZones(ctx context.Context, req *cofidectl_proto.ListTrustZonesRequest) (*cofidectl_proto.ListTrustZonesResponse, error)