func (e *BaseEndorsementStore) GetSupportedQueries() []string {
	keys := make([]string, 0, len(e.Queries))
	for k := range e.Queries {
		keys = append(keys, k)
	}
	return keys
}
GetSupportedQueries returns the list of name of queries supported by the
IEndorsementStore implementation.
package common
import (
	"fmt"
)
type EndorsementStoreParams map[string]interface{}
type SoftwareEndorsement struct {
	Measurement string `json:"measurement_value"`
	Type        string `json:"sw_component_type"`
	Version     string `json:"sw_component_version"`
	SignerID    string `json:"signer_id"`
}
type EndorsementMatches map[string]QueryResult
type IEndorsementStore interface {
	GetName() string
	Init(args EndorsementStoreParams) error
	GetEndorsements(qds ...QueryDescriptor) (EndorsementMatches, error)
	AddEndorsement(name string, args QueryArgs, update bool) error
	RunQuery(name string, args QueryArgs) (QueryResult, error)
	GetSupportedQueries() []string
	SupportsQuery(query string) bool
	Close() error
}
type BaseEndorsementStore struct {
	Queries map[string]Query
	Adders map[string]QueryAdder
}
func (e *BaseEndorsementStore) AddEndorsement(name string, args QueryArgs, update bool) error {
	adderFunc, ok := e.Adders[name]
	if !ok {
		return fmt.Errorf("no adder specified for %q", name)
	}
	return adderFunc(args, update)
}
func (e *BaseEndorsementStore) GetEndorsements(qds ...QueryDescriptor) (EndorsementMatches, error) {
	matches := make(EndorsementMatches)
	for _, qd := range qds {
		qr, err := e.RunQuery(qd.Name, qd.Args)
		if err != nil {
			return nil, err
		}
		if !checkConstraintHolds(qr, qd.Constraint) {
			return nil, fmt.Errorf("result for query %q failed to satisfy constraint", qd.Name)
		}
		matches[qd.Name] = qr
	}
	return matches, nil
}
func (e *BaseEndorsementStore) RunQuery(name string, args QueryArgs) (QueryResult, error) {
	queryFunc, ok := e.Queries[name]
	if !ok {
		return nil, fmt.Errorf("query %q not implemented", name)
	}
	result, err := queryFunc(args)
	if err != nil {
		return nil, err
	}
	return result, nil
}