Documentation
¶
Index ¶
- func GUnzippedBytes(input []byte) ([]byte, error)
- func GZippedBytes(input []byte) ([]byte, error)
- func GetAPI(ctx context.Context, client *gapic.RegistryClient, name names.Api, ...) error
- func GetArtifact(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, ...) error
- func GetArtifactMessageContents(artifact *rpc.Artifact) (proto.Message, error)
- func GetBytesForSpec(ctx context.Context, client connection.RegistryClient, spec *rpc.ApiSpec) ([]byte, error)
- func GetDeployment(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, ...) error
- func GetDeploymentRevision(ctx context.Context, client *gapic.RegistryClient, ...) error
- func GetProject(ctx context.Context, client *gapic.AdminClient, name names.Project, ...) error
- func GetSpec(ctx context.Context, client *gapic.RegistryClient, name names.Spec, ...) error
- func GetSpecRevision(ctx context.Context, client *gapic.RegistryClient, name names.SpecRevision, ...) error
- func GetVersion(ctx context.Context, client *gapic.RegistryClient, name names.Version, ...) error
- 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 ListDeploymentRevisions(ctx context.Context, client *gapic.RegistryClient, ...) 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.SpecRevision, ...) 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 NewLintFromOpenAPI(name string, spec []byte, linter string) (*rpc.Lint, error)
- func NewLintFromZippedProtos(name string, b []byte) (*rpc.Lint, error)
- func NewVocabularyFromZippedProtos(b []byte) (*metrics.Vocabulary, error)
- func PrintAPI(api *rpc.Api) error
- func PrintAPIDetail(message *rpc.Api) error
- func PrintArtifact(artifact *rpc.Artifact) error
- func PrintArtifactContents(artifact *rpc.Artifact) error
- func PrintArtifactDetail(artifact *rpc.Artifact) error
- func PrintDeployment(deployment *rpc.ApiDeployment) error
- func PrintDeploymentDetail(message *rpc.ApiDeployment) error
- func PrintMessage(message proto.Message)
- func PrintProject(project *rpc.Project) error
- func PrintProjectDetail(message *rpc.Project) error
- func PrintSpec(spec *rpc.ApiSpec) error
- func PrintSpecDetail(message *rpc.ApiSpec) error
- func PrintVersion(version *rpc.ApiVersion) error
- func PrintVersionDetail(message *rpc.ApiVersion) error
- 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 SummarizeZippedProtos(b []byte) (*metrics.Complexity, error)
- func UnzipArchiveToMap(b []byte) (map[string][]byte, error)
- func UnzipArchiveToPath(b []byte, dest string) ([]string, error)
- func VerifyLocation(ctx context.Context, client connection.RegistryClient, location string) error
- func WorkerPool(ctx context.Context, n int) (chan<- Task, func())
- func WorkerPoolWithWarnings(ctx context.Context, n int) (chan<- Task, func())
- func WriteArtifactContents(artifact *rpc.Artifact) error
- func WriteSpecContents(message *rpc.ApiSpec) error
- func ZipArchiveOfFiles(files []string, prefix string, recursive bool) (buf bytes.Buffer, err error)
- func ZipArchiveOfPath(path, prefix string, recursive bool) (buf bytes.Buffer, err error)
- type ApiHandler
- type ArtifactHandler
- type DeploymentHandler
- type Labeling
- type ProjectHandler
- 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 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) error
func GetArtifact ¶ added in v0.2.0
func GetArtifact(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, getContents bool, handler ArtifactHandler) error
func GetArtifactMessageContents ¶ added in v0.5.8
func GetBytesForSpec ¶
func GetBytesForSpec(ctx context.Context, client connection.RegistryClient, spec *rpc.ApiSpec) ([]byte, error)
func GetDeployment ¶ added in v0.4.2
func GetDeployment(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, handler DeploymentHandler) error
func GetDeploymentRevision ¶ added in v0.4.5
func GetDeploymentRevision(ctx context.Context, client *gapic.RegistryClient, name names.DeploymentRevision, handler DeploymentHandler) error
func GetProject ¶
func GetProject(ctx context.Context, client *gapic.AdminClient, name names.Project, handler ProjectHandler) error
func GetSpec ¶
func GetSpec(ctx context.Context, client *gapic.RegistryClient, name names.Spec, getContents bool, handler SpecHandler) error
func GetSpecRevision ¶ added in v0.4.5
func GetSpecRevision(ctx context.Context, client *gapic.RegistryClient, name names.SpecRevision, getContents bool, handler SpecHandler) error
func GetVersion ¶
func GetVersion(ctx context.Context, client *gapic.RegistryClient, name names.Version, handler VersionHandler) error
func ListAPIs ¶
func ListAPIs(ctx context.Context, client *gapic.RegistryClient, name names.Api, filter string, handler ApiHandler) error
func ListArtifacts ¶ added in v0.2.0
func ListArtifacts(ctx context.Context, client *gapic.RegistryClient, name names.Artifact, filter string, getContents bool, handler ArtifactHandler) error
func ListDeploymentRevisions ¶ added in v0.4.5
func ListDeploymentRevisions(ctx context.Context, client *gapic.RegistryClient, name names.DeploymentRevision, filter string, handler DeploymentHandler) error
func ListDeployments ¶ added in v0.4.2
func ListDeployments(ctx context.Context, client *gapic.RegistryClient, name names.Deployment, filter string, handler DeploymentHandler) error
func ListProjects ¶
func ListProjects(ctx context.Context, client *gapic.AdminClient, name names.Project, filter string, handler ProjectHandler) error
func ListSpecRevisions ¶
func ListSpecRevisions(ctx context.Context, client *gapic.RegistryClient, name names.SpecRevision, filter string, handler SpecHandler) error
func ListSpecs ¶
func ListSpecs(ctx context.Context, client *gapic.RegistryClient, name names.Spec, filter string, handler SpecHandler) error
func ListVersions ¶
func ListVersions(ctx context.Context, client *gapic.RegistryClient, name names.Version, filter string, handler VersionHandler) 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 NewVocabularyFromZippedProtos ¶
func NewVocabularyFromZippedProtos(b []byte) (*metrics.Vocabulary, error)
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) error
func PrintDeploymentDetail ¶ added in v0.4.2
func PrintDeploymentDetail(message *rpc.ApiDeployment) error
func PrintMessage ¶
func PrintProject ¶
func PrintProjectDetail ¶
func PrintSpecDetail ¶
func PrintVersion ¶
func PrintVersion(version *rpc.ApiVersion) error
func PrintVersionDetail ¶
func PrintVersionDetail(message *rpc.ApiVersion) error
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 SummarizeZippedProtos ¶ added in v0.4.5
func SummarizeZippedProtos(b []byte) (*metrics.Complexity, error)
func UnzipArchiveToMap ¶ added in v0.4.5
UnzipArchiveToMap will decompress a zip archive to a map. May be memory intensive for large zip archives.
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 VerifyLocation ¶ added in v0.5.7
func VerifyLocation(ctx context.Context, client connection.RegistryClient, location string) error
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 WorkerPoolWithWarnings ¶ added in v0.4.5
Similar to WorkerPool except it creates workers which log task errors as "Warnings"
func WriteArtifactContents ¶ added in v0.5.7
func WriteSpecContents ¶ added in v0.5.7
func ZipArchiveOfFiles ¶ added in v0.5.7
ZipArchiveOfFiles stores a list of files in a zip archive. The specified prefix is stripped from file names in the archive.
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) error
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 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) error