pkgsite

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Pkgsite

codeberg.ogr/yuce/pkgsite is a Go library for the https://pkg.go.dev/v1beta service. It is automatically generated from the OpenAPI spec.

Install

go get -u codeberg.org/yuce/pkgsite

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Body       []byte
}

APIError is returned for non-2xx responses.

func (*APIError) Error

func (e *APIError) Error() string

type Candidate

type Candidate struct {
	ModulePath  *string `json:"modulePath,omitempty"`
	PackagePath *string `json:"packagePath,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an HTTP client for the API.

func NewClient

func NewClient(opts ...ClientOption) *Client

NewClient creates a new Client.

func (*Client) GetImportedBy

func (c *Client) GetImportedBy(ctx context.Context, packagePath string, opts *GetImportedByOptions) (*PackageImportedBy, error)

GetImportedBy Paths of packages importing the package at package path, not including packages in the same module. Filtering is applied to the list of paths in the response. Only paths that match the filter query parameter are returned. Within a filter, the variable `path` is set to the import path.

func (*Client) GetModule

func (c *Client) GetModule(ctx context.Context, modulePath string, opts *GetModuleOptions) (*Module, error)

GetModule Information about the module at the given module path.

func (*Client) GetPackage

func (c *Client) GetPackage(ctx context.Context, packagePath string, opts *GetPackageOptions) (*Package, error)

GetPackage Information about the package at package path.

func (*Client) GetPackages

func (c *Client) GetPackages(ctx context.Context, modulePath string, opts *GetPackagesOptions) (*PackagesResponse, error)

GetPackages Information about packages of the module at module path. Filtering is applied to the list of packages in the response. Only packages that match the filter query parameter are returned.

func (*Client) GetSearch

func (c *Client) GetSearch(ctx context.Context, opts *GetSearchOptions) (*PaginatedResponse, error)

GetSearch Search results. Only results that match the filter query parameter are returned. Results are sorted by how well the match the query, with the best match first.

func (*Client) GetSymbols

func (c *Client) GetSymbols(ctx context.Context, packagePath string, opts *GetSymbolsOptions) (*PackageSymbols, error)

GetSymbols List of symbols for the package at package path. Filtering is applied to the list of symbols in the response. Only symbols that match the filter query parameter are returned.

func (*Client) GetVersions

func (c *Client) GetVersions(ctx context.Context, modulePath string, opts *GetVersionsOptions) (*PaginatedResponse, error)

GetVersions Versions of the module at module path. If there are tagged versions, they are returned. Otherwise, the 10 most recent pseudo-versions are returned. The versions are in descending order. Only results that match the filter query parameter are returned.

func (*Client) GetVulns

func (c *Client) GetVulns(ctx context.Context, moduleOrPackagePath string, opts *GetVulnsOptions) (*PaginatedResponse, error)

GetVulns Vulnerabilities of the module or package path, from the Go vulnerability database (https://vuln.go.dev). Only results that match the filter query parameter are returned.

type ClientOption

type ClientOption func(*Client)

ClientOption configures a Client.

func WithBasicAuth

func WithBasicAuth(ctx context.Context, user, password string) ClientOption

WithBasicAuth sets HTTP Basic authentication.

func WithBearerToken

func WithBearerToken(token string) ClientOption

WithBearerToken sets Authorization: Bearer <token>.

func WithHTTPClient

func WithHTTPClient(hc httpi.Doer) ClientOption

WithHTTPClient sets a custom httpi.Doer.

func WithHeader

func WithHeader(key, value string) ClientOption

WithHeader sets a default request header.

type Error

type Error struct {
	Candidates []*Candidate `json:"candidates,omitempty"`
	// HTTP status code
	Code *int64 `json:"code,omitempty"`
	// Unexported field for internal tracking
	Err interface{} `json:"err,omitempty"`
	// suggestions for how to fix
	Fixes   []string `json:"fixes,omitempty"`
	Message *string  `json:"message,omitempty"`
}

type GetImportedByOptions

type GetImportedByOptions struct {
	Filter  *string
	Limit   *int64
	Module  *string
	Token   *string
	Version *string
}

GetImportedByOptions holds optional parameters for GetImportedBy.

type GetModuleOptions

type GetModuleOptions struct {
	Licenses *bool
	Readme   *bool
	Version  *string
}

GetModuleOptions holds optional parameters for GetModule.

type GetPackageOptions

type GetPackageOptions struct {
	Doc      *string
	Examples *bool
	Goarch   *string
	Goos     *string
	Imports  *bool
	Licenses *bool
	Module   *string
	Version  *string
}

GetPackageOptions holds optional parameters for GetPackage.

type GetPackagesOptions

type GetPackagesOptions struct {
	Filter  *string
	Limit   *int64
	Token   *string
	Version *string
}

GetPackagesOptions holds optional parameters for GetPackages.

type GetSearchOptions

type GetSearchOptions struct {
	Filter *string
	Limit  *int64
	Q      *string
	Symbol *string
	Token  *string
}

GetSearchOptions holds optional parameters for GetSearch.

type GetSymbolsOptions

type GetSymbolsOptions struct {
	Filter  *string
	Goarch  *string
	Goos    *string
	Limit   *int64
	Module  *string
	Token   *string
	Version *string
}

GetSymbolsOptions holds optional parameters for GetSymbols.

type GetVersionsOptions

type GetVersionsOptions struct {
	Filter *string
	Limit  *int64
	Token  *string
}

GetVersionsOptions holds optional parameters for GetVersions.

type GetVulnsOptions

type GetVulnsOptions struct {
	Filter  *string
	Limit   *int64
	Module  *string
	Token   *string
	Version *string
}

GetVulnsOptions holds optional parameters for GetVulns.

type License

type License struct {
	Contents *string  `json:"contents,omitempty"`
	FilePath *string  `json:"filePath,omitempty"`
	Types    []string `json:"types,omitempty"`
}

type Module

type Module struct {
	// CommitTime is the timestamp returned by the module proxy's .info endpoint,
	// representing the time the version was created.
	CommitTime        *string    `json:"commitTime,omitempty"`
	GoModContents     *string    `json:"goModContents,omitempty"`
	HasGoMod          *bool      `json:"hasGoMod,omitempty"`
	IsLatest          *bool      `json:"isLatest,omitempty"`
	IsRedistributable *bool      `json:"isRedistributable,omitempty"`
	IsStandardLibrary *bool      `json:"isStandardLibrary,omitempty"`
	Licenses          []*License `json:"licenses,omitempty"`
	Path              *string    `json:"path,omitempty"`
	Readme            *Readme    `json:"readme,omitempty"`
	RepoUrl           *string    `json:"repoUrl,omitempty"`
	Version           *string    `json:"version,omitempty"`
}

type ModuleVersion

type ModuleVersion struct {
	CommitTime        *string `json:"commitTime,omitempty"`
	Deprecated        *bool   `json:"deprecated,omitempty"`
	DeprecationReason *string `json:"deprecationReason,omitempty"`
	// Whether the module has a go.mod file.
	HasGoMod *bool `json:"hasGoMod,omitempty"`
	// Whether the license allows distribution.
	IsRedistributable *bool `json:"isRedistributable,omitempty"`
	// latest unretracted version
	LatestVersion    *string `json:"latestVersion,omitempty"`
	ModulePath       *string `json:"modulePath,omitempty"`
	Retracted        *bool   `json:"retracted,omitempty"`
	RetractionReason *string `json:"retractionReason,omitempty"`
	Version          *string `json:"version,omitempty"`
}

type Package

type Package struct {
	Docs     *string  `json:"docs,omitempty"`
	Goarch   *string  `json:"goarch,omitempty"`
	Goos     *string  `json:"goos,omitempty"`
	Imports  []string `json:"imports,omitempty"`
	IsLatest *bool    `json:"isLatest,omitempty"`
	// Whether the license allows distribution.
	IsRedistributable *bool      `json:"isRedistributable,omitempty"`
	IsStandardLibrary *bool      `json:"isStandardLibrary,omitempty"`
	Licenses          []*License `json:"licenses,omitempty"`
	ModulePath        *string    `json:"modulePath,omitempty"`
	Name              *string    `json:"name,omitempty"`
	Path              *string    `json:"path,omitempty"`
	Synopsis          *string    `json:"synopsis,omitempty"`
	Version           *string    `json:"version,omitempty"`
}

type PackageImportedBy

type PackageImportedBy struct {
	ImportedBy *PaginatedResponse `json:"importedBy,omitempty"`
	ModulePath *string            `json:"modulePath,omitempty"`
	Version    *string            `json:"version,omitempty"`
}

type PackageInfo

type PackageInfo struct {
	// Whether the license allows distribution.
	IsRedistributable *bool   `json:"isRedistributable,omitempty"`
	Name              *string `json:"name,omitempty"`
	Path              *string `json:"path,omitempty"`
	Synopsis          *string `json:"synopsis,omitempty"`
}

type PackageSymbols

type PackageSymbols struct {
	ModulePath *string            `json:"modulePath,omitempty"`
	Symbols    *PaginatedResponse `json:"symbols,omitempty"`
	Version    *string            `json:"version,omitempty"`
}

type PackagesResponse

type PackagesResponse struct {
	IsStandardLibrary *bool              `json:"isStandardLibrary,omitempty"`
	ModulePath        *string            `json:"modulePath,omitempty"`
	Packages          *PaginatedResponse `json:"packages,omitempty"`
	Version           *string            `json:"version,omitempty"`
}

type PaginatedResponse

type PaginatedResponse struct {
	Items         []map[string]interface{} `json:"items,omitempty"`
	NextPageToken *string                  `json:"nextPageToken,omitempty"`
	Total         *int64                   `json:"total,omitempty"`
}

type Readme

type Readme struct {
	Contents *string `json:"contents,omitempty"`
	Filepath *string `json:"filepath,omitempty"`
}

type SearchResult

type SearchResult struct {
	ModulePath  *string `json:"modulePath,omitempty"`
	PackagePath *string `json:"packagePath,omitempty"`
	Synopsis    *string `json:"synopsis,omitempty"`
	Version     *string `json:"version,omitempty"`
}

type Symbol

type Symbol struct {
	Kind     *string `json:"kind,omitempty"`
	Name     *string `json:"name,omitempty"`
	Parent   *string `json:"parent,omitempty"`
	Synopsis *string `json:"synopsis,omitempty"`
}

type Vulnerability

type Vulnerability struct {
	Details      *string `json:"details,omitempty"`
	FixedVersion *string `json:"fixedVersion,omitempty"`
	Id           *string `json:"id,omitempty"`
	Summary      *string `json:"summary,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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