Skip to content

Commit c4b33fe

Browse files
authored
feat: Add GetDestinations function to list all destinations (#120)
Required for cloudquery/cloudquery#1847 ---
1 parent bac15be commit c4b33fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

specs/spec_reader.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ func (s *SpecReader) GetSourceByName(name string) *Source {
6262
return nil
6363
}
6464

65+
func (s *SpecReader) GetDestinations() []Destination {
66+
destinations := make([]Destination, 0, len(s.destinations))
67+
for _, spec := range s.destinations {
68+
destinations = append(destinations, spec)
69+
}
70+
return destinations
71+
}
72+
6573
func (s *SpecReader) GetDestinationByName(name string) *Destination {
6674
for _, spec := range s.destinations {
6775
if spec.Name == name {

0 commit comments

Comments
 (0)