api

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version       = "0.0.11"
	VersionCommit = ""
)

Version and VersionCommit hold the version information

Functions

func GetLanguageAliases

func GetLanguageAliases() map[string]source.Type

GetLanguageAliases returns a map of language aliases to their documentation source types

Types

type InitialQuery added in v0.0.11

type InitialQuery struct {
	SourceRef source.Reference

	// ForceUpdate determines whether to forcibly update by ignoring the cache
	ForceUpdate bool
}

InitialQuery is a structure that represents the initial query created from user input

func DetectInitialQuery added in v0.0.11

func DetectInitialQuery(pkgPath string, explicitLang string) InitialQuery

DetectInitialQuery attempts to detect the documentation source from a package path If explicitLang is provided, it will be used as an explicit language hint

func NewInitialQuery added in v0.0.11

func NewInitialQuery(input UserInput) InitialQuery

NewInitialQuery creates an initial query from user input

type Investigation added in v0.0.11

type Investigation struct {
	// Query is the initial query
	Query InitialQuery

	// CollectedData is data collected from each source
	CollectedData map[source.Type]source.Data
}

Investigation is a structure that represents data under investigation

func NewInvestigation added in v0.0.11

func NewInvestigation(query InitialQuery) *Investigation

NewInvestigation creates a new investigation

func (*Investigation) Do added in v0.0.11

func (i *Investigation) Do() error

func (Investigation) IsSufficient added in v0.0.11

func (i Investigation) IsSufficient() bool
type Link struct {
	Type source.Type
	URL  *url.URL
}

type Result added in v0.0.11

type Result struct {
	README string

	InitialQueryURL  *url.URL
	InitialQueryType source.Type
	Links            []Link
}

Result is a structure that represents the investigation result

func CreateResult added in v0.0.11

func CreateResult(inv *Investigation) Result

CreateResult generates a result from investigation data

func (Result) GetDocumentation added in v0.0.11

func (r Result) GetDocumentation() *url.URL

func (Result) GetHomepage added in v0.0.11

func (r Result) GetHomepage() *url.URL

func (Result) GetRegistry added in v0.0.11

func (r Result) GetRegistry() *url.URL

func (Result) GetRepository added in v0.0.11

func (r Result) GetRepository() *url.URL

type UserInput added in v0.0.11

type UserInput struct {
	// PackagePath is the path of the package
	PackagePath string
	// Language is the explicitly specified language
	Language string
	// ForceUpdate determines whether to forcibly update by ignoring the cache
	ForceUpdate bool
}

UserInput is a structure that represents input from the user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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