api

package
v0.0.0-...-7ef6195 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB map[string]PkgDB // keyed by Go package ("net/http")

DB is a map of packages to information about those packages' symbols and when they were added to Go.

Only things added after Go1 are tracked. Version strings are of the form "1.1", "1.2", etc.

func Load

func Load(fsys fs.FS) (DB, error)

Load loads a database from fsys's api/go*.txt files. Typically, fsys should be the root of a Go repository (a $GOROOT).

func (DB) Func

func (v DB) Func(pkg, kind, receiver, name string) string

Func returns a string (such as "1.7") specifying which Go version introduced a symbol, unless it was introduced in Go1, in which case it returns the empty string.

The kind is one of "type", "method", or "func".

The receiver is only used for "methods" and specifies the receiver type, such as "*Server".

The name is the symbol name ("Server") and the pkg is the package ("net/http").

type PkgDB

type PkgDB struct {
	Type   map[string]string            // "Server" -> "1.7"
	Method map[string]map[string]string // "*Server" ->"Shutdown"->1.8
	Func   map[string]string            // "NewServer" -> "1.7"
	Field  map[string]map[string]string // "ClientTrace" -> "Got1xxResponse" -> "1.11"
}

PkgDB contains information about which version of Go added certain package symbols.

Only things added after Go1 are tracked. Version strings are of the form "1.1", "1.2", etc.

Jump to

Keyboard shortcuts

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