Documentation ¶
Overview ¶
Package gnostic_vocabulary provides operation for Vocabulary structs
Index ¶
- func Difference(vocabularies []*metrics.Vocabulary) *metrics.Vocabulary
- func FilterCommon(v []*metrics.Vocabulary) *metrics.VocabularyList
- func GatherFilesFromDirectory(directory string) ([]string, error)
- func Intersection(vocabSlices []*metrics.Vocabulary) *metrics.Vocabulary
- func NewVocabularyFromDiscovery(document *discovery_v1.Document) *metrics.Vocabulary
- func NewVocabularyFromOpenAPIv2(document *openapi_v2.Document) *metrics.Vocabulary
- func NewVocabularyFromOpenAPIv3(document *openapi_v3.Document) *metrics.Vocabulary
- func Union(vocabularies []*metrics.Vocabulary) *metrics.Vocabulary
- func Version(v []*metrics.Vocabulary, versionNames []string, directory string) *metrics.VersionHistory
- func WriteCSV(v *metrics.Vocabulary, filename string) error
- func WritePb(v *metrics.Vocabulary) error
- func WriteVersionHistory(v *metrics.VersionHistory, directory string) error
- func WriteVocabularyList(v *metrics.VocabularyList) error
- type Vocabulary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
func Difference(vocabularies []*metrics.Vocabulary) *metrics.Vocabulary
Difference implements the difference operation between multiple Vocabularies. The function accepts a slice of Vocabularies and returns a single Vocabulary struct which that contains words that were unique to the first Vocabulary in the slice.
func FilterCommon ¶
func FilterCommon(v []*metrics.Vocabulary) *metrics.VocabularyList
FilterCommon implements the difference operation amongst a slice of Vocabularies. The function returns a slice of Vocabularies that contains the unique terms for each pb file.
func GatherFilesFromDirectory ¶
GatherFilesFromDirectory takes a directory path as input and returns all of the file paths within the directory that contain the "vocabulary.pb" file.
func Intersection ¶
func Intersection(vocabSlices []*metrics.Vocabulary) *metrics.Vocabulary
Intersection implements the intersection operation between multiple Vocabularies. The function accepts a slice of Vocabularies and returns a single Vocabulary struct which that contains words that were found in all of the Vocabularies.
func NewVocabularyFromDiscovery ¶
func NewVocabularyFromDiscovery(document *discovery_v1.Document) *metrics.Vocabulary
NewVocabularyFromDiscovery collects the vocabulary of a Discovery document.
func NewVocabularyFromOpenAPIv2 ¶
func NewVocabularyFromOpenAPIv2(document *openapi_v2.Document) *metrics.Vocabulary
func NewVocabularyFromOpenAPIv3 ¶
func NewVocabularyFromOpenAPIv3(document *openapi_v3.Document) *metrics.Vocabulary
func Union ¶
func Union(vocabularies []*metrics.Vocabulary) *metrics.Vocabulary
Union implements the union operation between multiple Vocabularies. The function accepts a slice of Vocabularies and returns a single Vocabulary struct which contains all of the data from the Vocabularies.
func Version ¶
func Version(v []*metrics.Vocabulary, versionNames []string, directory string) *metrics.VersionHistory
Version implements the difference and union operation amongst a list of vocabularies that represent different versions of the same API. This function utilizes the VersionHistory proto struct, and creates a new version struct for each comparison between vocabularies.
func WriteCSV ¶
func WriteCSV(v *metrics.Vocabulary, filename string) error
WriteCSV converts a Vocabulary pb file to a user-friendly readable CSV file. The format of the CSV file is as follows: "group","word","frequency"
func WritePb ¶
func WritePb(v *metrics.Vocabulary) error
WritePb create a protocol buffer file that contains the wire-format encoding of a Vocabulary struct.
func WriteVersionHistory ¶
func WriteVersionHistory(v *metrics.VersionHistory, directory string) error
WriteVersionHistory create a protocol buffer file that contains the wire-format encoding of a VersionHistory struct.
func WriteVocabularyList ¶
func WriteVocabularyList(v *metrics.VocabularyList) error
WriteVocabularyList create a protocol buffer file that contains the wire-format encoding of a VocabularyList struct.
Types ¶
type Vocabulary ¶
type Vocabulary struct {
// contains filtered or unexported fields
}