search

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: GPL-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Find returns the list of matching modules
	Find(ctx context.Context, query Query) ([]Module, error)
	// ResolveSource returns the source for a module - this is only a requirement for
	// terraform registries as they don't show the tag on the module versions
	ResolveSource(ctx context.Context, module Module) (string, error)
	// Source returns the source for the search service
	Source() string
	// Versions returns a list of versions for a module
	Versions(ctx context.Context, module Module) ([]string, error)
}

Interface for the search service

type Module

type Module struct {
	// ID is a unique if for the module
	ID string `json:"id"`
	// CreatedAt is the module creation date
	CreatedAt time.Time `json:"created_at"`
	// Description is the module description
	Description string `json:"description"`
	// Downloads is the number of downloads the module has
	Downloads int `json:"downloads"`
	// Name is the module name
	Name string `json:"name"`
	// Namespace is the module namespace
	Namespace string `json:"namespace"`
	// Private indicates if the repostory is private
	Private bool
	// Provider is the module provider
	Provider string `json:"provider"`
	// Registry is the registry the module is published to
	Registry string `json:"registry"`
	// RegistryType is the short name for the type of registry
	RegistryType string `json:"registry_type"`
	// Source is the module source
	Source string `json:"source"`
	// Stars is the number of stars the module has
	Stars int `json:"stars"`
	// Version is the latest version
	Version string `json:"version"`
}

Module is a agnostic representation of a module

type Query

type Query struct {
	// Namespace is the namespace of the query
	Namespace string `json:"namespace"`
	// Provider is the provider your looking for modules for
	Provider string `json:"provider"`
	// Query is a provider specific query string
	Query string `json:"query"`
}

Query represents a search query

type Response

type Response struct {
	// Error is the error if one occurred
	Error error `json:"error"`
	// Modules is the list of modules found
	Modules []Module `json:"modules"`
	// Time is the amount of time taken to perform the search
	Time time.Duration `json:"time"`
}

Response is the response from a search query

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL