Skip to content

Commit

Permalink
adding function to add a single attestor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosInTheCRD committed Dec 15, 2023
1 parent 5b5647c commit f2f52f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion attestation/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ func FactoryByName(name string) (registry.FactoryFunc[Attestor], bool) {
return registrationEntry.Factory, ok
}

func Attestors(nameOrTypes []string) ([]Attestor, error) {
func AddAttestor(nameOrType string) (Attestor, error) {
attestors, err := AddAttestors([]string{nameOrType})
if err != nil {
return nil, err
}
return attestors[0], nil
}

func AddAttestors(nameOrTypes []string) ([]Attestor, error) {
attestors := make([]Attestor, 0)
for _, nameOrType := range nameOrTypes {
factory, ok := FactoryByName(nameOrType)
Expand Down

0 comments on commit f2f52f0

Please sign in to comment.