Documentation
¶
Index ¶
- func AlreadyExists(err error) bool
- func DiscoveryMimeType(compression string) string
- func EnsureProjectExists(ctx context.Context, client *gapic.AdminClient, projectID string)
- func ExportAsJSON(index *rpc.Index) error
- func ExportComplexityToSheet(ctx context.Context, name string, inputs []*rpc.Artifact) (string, error)
- func ExportFields(index *rpc.Index) error
- func ExportIndexToSheet(ctx context.Context, name string, index *rpc.Index) (string, error)
- func ExportInt64ToSheet(ctx context.Context, name string, artifacts []*rpc.Artifact) (string, error)
- func ExportOperations(index *rpc.Index) error
- func ExportSchemas(index *rpc.Index) error
- func ExportVersionHistoryToSheet(ctx context.Context, name string, artifact *rpc.Artifact) (string, error)
- func ExportVocabularyToSheet(ctx context.Context, name string, vocabulary *metrics.Vocabulary) (string, error)
- func ExportYAMLForAPI(ctx context.Context, client *gapic.RegistryClient, message *rpc.Api)
- func ExportYAMLForProject(ctx context.Context, client *gapic.RegistryClient, ...)
- func ExportYAMLForSpec(ctx context.Context, client *gapic.RegistryClient, message *rpc.ApiSpec)
- func ExportYAMLForVersion(ctx context.Context, client *gapic.RegistryClient, message *rpc.ApiVersion)
- func GUnzippedBytes(input []byte) ([]byte, error)
- func GZippedBytes(input []byte) ([]byte, error)
- func GetAPI(ctx context.Context, client *gapic.RegistryClient, name names.Api, ...) (*rpc.Api, error)
- func GetArtifact(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, ...) (*rpc.Artifact, error)
- func GetBytesForSpec(ctx context.Context, client connection.Client, spec *rpc.ApiSpec) ([]byte, error)
- func GetDeployment(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, ...) (*rpc.ApiDeployment, error)
- func GetProject(ctx context.Context, client *gapic.AdminClient, name names.Project, ...) (*rpc.Project, error)
- func GetSpec(ctx context.Context, client *gapic.RegistryClient, name names.Spec, ...) (*rpc.ApiSpec, error)
- func GetVersion(ctx context.Context, client *gapic.RegistryClient, name names.Version, ...) (*rpc.ApiVersion, error)
- func IndexUnion(inputs []*rpc.Index) *rpc.Index
- func IsAsyncAPIv2(mimeType string) bool
- func IsDiscovery(mimeType string) bool
- func IsGZipCompressed(mimeType string) bool
- func IsOpenAPIv2(mimeType string) bool
- func IsOpenAPIv3(mimeType string) bool
- func IsProto(mimeType string) bool
- func IsZipArchive(mimeType string) bool
- func ListAPIs(ctx context.Context, client *gapic.RegistryClient, name names.Api, ...) error
- func ListArtifacts(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, ...) error
- func ListArtifactsForParent(ctx context.Context, client *gapic.RegistryClient, parent names.Name, ...) error
- func ListDeployments(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, ...) error
- func ListProjects(ctx context.Context, client *gapic.AdminClient, name names.Project, ...) error
- func ListSpecRevisions(ctx context.Context, client *gapic.RegistryClient, name names.Spec, ...) error
- func ListSpecs(ctx context.Context, client *gapic.RegistryClient, name names.Spec, ...) error
- func ListVersions(ctx context.Context, client *gapic.RegistryClient, name names.Version, ...) error
- func MessageTypeForMimeType(protoType string) (string, error)
- func MimeTypeForMessageType(protoType string) string
- func NewComplexityFromZippedProtos(b []byte) (*metrics.Complexity, error)
- func NewIndexFromZippedProtos(b []byte) (*rpc.Index, error)
- func NewLintFromOpenAPI(name string, spec []byte, linter string) (*rpc.Lint, error)
- func NewLintFromZippedProtos(name string, b []byte) (*rpc.Lint, error)
- func NewReferencesFromZippedProtos(b []byte) (*rpc.References, error)
- func NewVocabularyFromZippedProtos(b []byte) (*metrics.Vocabulary, error)
- func NotFound(err error) bool
- func OpenAPIMimeType(compression, version string) string
- func ParentAndIdOfResourceNamed(name string) (string, string)
- func PrintAPI(api *rpc.Api)
- func PrintAPIDetail(message *rpc.Api)
- func PrintArtifact(artifact *rpc.Artifact)
- func PrintArtifactContents(artifact *rpc.Artifact)
- func PrintArtifactDetail(artifact *rpc.Artifact)
- func PrintDeployment(deployment *rpc.ApiDeployment)
- func PrintDeploymentDetail(message *rpc.ApiDeployment)
- func PrintMessage(message proto.Message)
- func PrintProject(project *rpc.Project)
- func PrintProjectDetail(message *rpc.Project)
- func PrintSpec(spec *rpc.ApiSpec)
- func PrintSpecContents(message *rpc.ApiSpec)
- func PrintSpecDetail(message *rpc.ApiSpec)
- func PrintVersion(version *rpc.ApiVersion)
- func PrintVersionDetail(message *rpc.ApiVersion)
- func ProjectID(name string) (string, error)
- func ProtobufMimeType(compression string) string
- func ResourceNameOfSpec(segments []string) string
- func SetArtifact(ctx context.Context, client *gapic.RegistryClient, artifact *rpc.Artifact) error
- func SummarizeDiscoveryDocument(document *discovery.Document) *metrics.Complexity
- func SummarizeOpenAPIv2Document(document *openapi_v2.Document) *metrics.Complexity
- func SummarizeOpenAPIv3Document(document *openapi_v3.Document) *metrics.Complexity
- func UnzipArchiveToPath(b []byte, dest string) ([]string, error)
- func UpdateMap(m map[string]string, keyOverwrite bool, keysToSet map[string]string, ...) (map[string]string, error)
- func UploadBytesForSpec(ctx context.Context, client connection.Client, parent, specID, style string, ...) error
- func WorkerPool(ctx context.Context, n int) (chan<- Task, func())
- func ZipArchiveOfPath(path, prefix string) (buf bytes.Buffer, err error)
- type ApiHandler
- type ArtifactHandler
- type DeploymentHandler
- type Details
- type Labeling
- type ProjectHandler
- type SheetsClient
- func (sc *SheetsClient) CreateSheet(title string, sheetTitles []string) (*sheets.Spreadsheet, error)
- func (sc *SheetsClient) Fetch(ctx context.Context, cellRange string) (*sheets.ValueRange, error)
- func (sc *SheetsClient) FormatHeaderRow(ctx context.Context, sheetId int64) (*sheets.BatchUpdateSpreadsheetResponse, error)
- func (sc *SheetsClient) Update(ctx context.Context, cellRange string, values [][]interface{}) (*sheets.UpdateValuesResponse, error)
- type SpecHandler
- type SpectralLintLocation
- type SpectralLintRange
- type SpectralLintResult
- type Task
- type VersionHandler
- type Vocabulary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlreadyExists ¶
func DiscoveryMimeType ¶ added in v0.2.0
DiscoveryMimeType returns a MIME type for a Discovery description of an API.
func EnsureProjectExists ¶
func EnsureProjectExists(ctx context.Context, client *gapic.AdminClient, projectID string)
func ExportAsJSON ¶
ExportAsJSON writes a index as a JSON file
func ExportComplexityToSheet ¶
func ExportFields ¶
ExportFields writes an index of Fields as a CSV
func ExportIndexToSheet ¶
func ExportInt64ToSheet ¶
func ExportOperations ¶
ExportOperations writes an index of Operations as a CSV
func ExportSchemas ¶
ExportSchemas writes an index of Schemas as a CSV
func ExportVocabularyToSheet ¶
func ExportYAMLForAPI ¶
ExportYAMLForAPI writes a project as a YAML file.
func ExportYAMLForProject ¶
func ExportYAMLForProject(ctx context.Context, client *gapic.RegistryClient, adminClient *gapic.AdminClient, message *rpc.Project)
ExportYAMLForProject writes a project as a YAML file.
func ExportYAMLForSpec ¶
ExportYAMLForSpec writes a project as a YAML file.
func ExportYAMLForVersion ¶
func ExportYAMLForVersion(ctx context.Context, client *gapic.RegistryClient, message *rpc.ApiVersion)
ExportYAMLForVersion writes a project as a YAML file.
func GUnzippedBytes ¶
GUnzippedBytes uncompresses a slice of bytes.
func GZippedBytes ¶
GZippedBytes compresses a slice of bytes.
func GetAPI ¶
func GetAPI(ctx context.Context, client *gapic.RegistryClient, name names.Api, handler ApiHandler) (*rpc.Api, error)
func GetArtifact ¶ added in v0.2.0
func GetBytesForSpec ¶
func GetDeployment ¶ added in v0.4.2
func GetDeployment(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, handler DeploymentHandler) (*rpc.ApiDeployment, error)
func GetProject ¶
func GetProject(ctx context.Context, client *gapic.AdminClient, name names.Project, handler ProjectHandler) (*rpc.Project, error)
func GetVersion ¶
func GetVersion(ctx context.Context, client *gapic.RegistryClient, name names.Version, handler VersionHandler) (*rpc.ApiVersion, error)
func IsAsyncAPIv2 ¶ added in v0.3.1
IsAsyncAPIv2 returns true if a MIME type represents an AsyncAPI v2 spec.
func IsDiscovery ¶ added in v0.2.0
IsDiscovery returns true if a MIME type represents a Google API Discovery document.
func IsGZipCompressed ¶ added in v0.2.0
IsGZipCompressed returns true if a MIME type represents a type compressed with GZip encoding.
func IsOpenAPIv2 ¶ added in v0.2.0
IsOpenAPIv2 returns true if a MIME type represents an OpenAPI v2 spec.
func IsOpenAPIv3 ¶ added in v0.2.0
IsOpenAPIv3 returns true if a MIME type represents an OpenAPI v3 spec.
func IsProto ¶ added in v0.2.0
IsProto returns true if a MIME type represents a Protocol Buffers Language API description.
func IsZipArchive ¶ added in v0.2.0
IsZipArchive returns true if a MIME type represents a type stored as a multifile Zip archive.
func ListAPIs ¶
func ListAPIs(ctx context.Context, client *gapic.RegistryClient, name names.Api, filterFlag string, handler ApiHandler) error
func ListArtifacts ¶ added in v0.2.0
func ListArtifacts(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, filterFlag string, getContents bool, handler ArtifactHandler) error
func ListArtifactsForParent ¶ added in v0.2.0
func ListArtifactsForParent(ctx context.Context, client *gapic.RegistryClient, parent names.Name, handler ArtifactHandler) error
func ListDeployments ¶ added in v0.4.2
func ListDeployments(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, filterFlag string, handler DeploymentHandler) error
func ListProjects ¶
func ListProjects(ctx context.Context, client *gapic.AdminClient, name names.Project, filterFlag string, handler ProjectHandler) error
func ListSpecRevisions ¶
func ListSpecRevisions(ctx context.Context, client *gapic.RegistryClient, name names.Spec, filterFlag string, handler SpecHandler) error
func ListSpecs ¶
func ListSpecs(ctx context.Context, client *gapic.RegistryClient, name names.Spec, filterFlag string, handler SpecHandler) error
func ListVersions ¶
func ListVersions(ctx context.Context, client *gapic.RegistryClient, name names.Version, filterFlag string, handler VersionHandler) error
func MessageTypeForMimeType ¶ added in v0.2.0
MessageTypeForMimeType returns the Protocol Buffer message type represented by a MIME type.
func MimeTypeForMessageType ¶ added in v0.2.0
MimeTypeForMessageType returns a MIME type that represents a Protocol Buffer message type.
func NewComplexityFromZippedProtos ¶
func NewComplexityFromZippedProtos(b []byte) (*metrics.Complexity, error)
func NewLintFromOpenAPI ¶ added in v0.2.0
NewLintFromOpenAPI runs the API linter and returns the results.
func NewLintFromZippedProtos ¶ added in v0.2.0
NewLintFromZippedProtos runs the API linter and returns the results.
func NewReferencesFromZippedProtos ¶ added in v0.2.1
func NewReferencesFromZippedProtos(b []byte) (*rpc.References, error)
NewReferencesFromZippedProtos computes references of a Protobuf spec.
func NewVocabularyFromZippedProtos ¶
func NewVocabularyFromZippedProtos(b []byte) (*metrics.Vocabulary, error)
func OpenAPIMimeType ¶ added in v0.2.0
OpenAPIMimeType returns a MIME type for an OpenAPI description of an API.
func ParentAndIdOfResourceNamed ¶
ParentAndIdOfResourceNamed returns the name of a resource's parent and its resource ID.
func PrintAPIDetail ¶
func PrintArtifact ¶ added in v0.2.0
func PrintArtifactContents ¶ added in v0.2.0
func PrintArtifactDetail ¶ added in v0.2.0
func PrintDeployment ¶ added in v0.4.2
func PrintDeployment(deployment *rpc.ApiDeployment)
func PrintDeploymentDetail ¶ added in v0.4.2
func PrintDeploymentDetail(message *rpc.ApiDeployment)
func PrintMessage ¶
func PrintProject ¶
func PrintProjectDetail ¶
func PrintSpecContents ¶
func PrintSpecDetail ¶
func PrintVersion ¶
func PrintVersion(version *rpc.ApiVersion)
func PrintVersionDetail ¶
func PrintVersionDetail(message *rpc.ApiVersion)
func ProtobufMimeType ¶ added in v0.2.1
ProtobufMimeType returns a MIME type for a Protocol Buffers description of an API.
func ResourceNameOfSpec ¶
func SetArtifact ¶ added in v0.2.0
func SummarizeDiscoveryDocument ¶
func SummarizeDiscoveryDocument(document *discovery.Document) *metrics.Complexity
func SummarizeOpenAPIv2Document ¶
func SummarizeOpenAPIv2Document(document *openapi_v2.Document) *metrics.Complexity
func SummarizeOpenAPIv3Document ¶
func SummarizeOpenAPIv3Document(document *openapi_v3.Document) *metrics.Complexity
func UnzipArchiveToPath ¶
UnzipArchiveToPath will decompress a zip archive, writing all files and folders within the zip archive (parameter 1) to an output directory (parameter 2). Based on an example published at https://golangcode.com/unzip-files-in-go/
func UpdateMap ¶ added in v0.3.0
func UpdateMap(m map[string]string, keyOverwrite bool, keysToSet map[string]string, keysToClear []string) (map[string]string, error)
UpdateMap updates a map containing labels or annotations to be modified.
func UploadBytesForSpec ¶
func WorkerPool ¶ added in v0.3.1
This function creates a waitgroup and a taskQueue for the workerPool. It will create "n" workers which will listen for Tasks on the taskQueue. It returns the taskQueue and a wait func. The clients should add new tasks to this taskQueue and call the call the wait func when done. Do not separately close the taskQueue, make use of the wait func.
func ZipArchiveOfPath ¶
ZipArchiveOfPath reads the contents of a path into a zip archive. The specified prefix is stripped from file names in the archive. Based on an example published at https://golangcode.com/create-zip-files-in-go/
Types ¶
type ApiHandler ¶
type ArtifactHandler ¶ added in v0.2.0
type DeploymentHandler ¶ added in v0.4.2
type DeploymentHandler func(*rpc.ApiDeployment)
type Labeling ¶ added in v0.3.0
Labeling represents a user-specified change to a set of labels or annotations. Note that this same structure is used for both labels and annotations.
type ProjectHandler ¶
type SheetsClient ¶
type SheetsClient struct {
// contains filtered or unexported fields
}
SheetsClient represents a client of the Sheets API.
func NewSheetsClient ¶
func NewSheetsClient(ctx context.Context, id string) (*SheetsClient, error)
NewSheetsClient creates an authenticated client of the Sheets API.
func (*SheetsClient) CreateSheet ¶
func (sc *SheetsClient) CreateSheet(title string, sheetTitles []string) (*sheets.Spreadsheet, error)
CreateSheet creates a new spreadsheet and configures the client to point to it.
func (*SheetsClient) Fetch ¶
func (sc *SheetsClient) Fetch(ctx context.Context, cellRange string) (*sheets.ValueRange, error)
Fetch gets the contents of the configured sheet.
func (*SheetsClient) FormatHeaderRow ¶
func (sc *SheetsClient) FormatHeaderRow(ctx context.Context, sheetId int64) (*sheets.BatchUpdateSpreadsheetResponse, error)
FormatHeaderRow freezes and bolds the top row of the configured sheet.
type SpecHandler ¶
type SpectralLintLocation ¶ added in v0.2.0
type SpectralLintRange ¶ added in v0.2.0
type SpectralLintRange struct { Start SpectralLintLocation `json:"start"` End SpectralLintLocation `json:"end"` }
type SpectralLintResult ¶ added in v0.2.0
type VersionHandler ¶
type VersionHandler func(*rpc.ApiVersion)
type Vocabulary ¶
type Vocabulary struct { Schemas map[string]int Operations map[string]int Parameters map[string]int Properties map[string]int }
Vocabulary represents the counts of various types of terms in an API.
func NewVocabulary ¶
func NewVocabulary() *Vocabulary
NewVocabulary creates a new Vocabulary object.
Source Files
¶
- artifact-export.go
- artifacts.go
- codes.go
- complexity-export.go
- complexity-proto.go
- complexity.go
- details-proto.go
- get.go
- gzip.go
- handlers.go
- index-export.go
- index-operations.go
- index-proto.go
- labeling.go
- lint-openapi-gnostic.go
- lint-openapi-spectral.go
- lint-openapi.go
- lint-proto.go
- list.go
- print.go
- projects.go
- references.go
- resources.go
- sheets.go
- specs.go
- tasks.go
- types.go
- versionhistory-export.go
- vocabulary-export.go
- vocabulary-proto.go
- yaml.go
- zip.go