Documentation ¶
Index ¶
- Constants
- Variables
- func BuildLineOffsets(content []byte, onlyStatLineCount bool) (int, []int)
- func DotDotSlashes(count int) string
- func FindPackageCommonPrefixPaths(pa, pb string) string
- func GenDocs(options PageOutputOptions, args []string, outputDir string, silentMode bool, ...)
- func GenTestData(args []string, outputDir string, silent bool, printUsage func(io.Writer))
- func GoldsUpdateGoSubCommand(pkgPath string) string
- func ImprovePackagesForListing(pkgs []*PackageForListing)
- func NewHtmlPage(goldsVersion, title string, theme Theme, translation Translation, ...) *htmlPage
- func ParseGoVersion(versionStr []byte) (major, minor int64, err error)
- func PreviousVersion(version string) string
- func RelativePath(a, b string) string
- func Run(options PageOutputOptions, args []string, recommendedPort string, ...)
- type BuildSourceLinkFunc
- type ChanCommOprator
- type CodeHost
- type Content
- type ContentPool
- type FileInfo
- type KeywordToken
- type LoadingLogMessage
- type MethodImplementationResult
- type MethodImplementations
- type MethodInfo
- type ObjectReferences
- type Overview
- type PackageDependencyInfo
- type PackageDetails
- type PackageForListing
- type PageOutputOptions
- type ReferencesResult
- type ResourceWithPosition
- type SelectorForListing
- type SourceFileAnalyzeResult
- type TestData_Package
- type TestData_Type
- type Theme
- type Translation
- type TypeDetails
- type TypeForListing
- type ValueForListing
Constants ¶
View Source
const ( UpdateTip_Nothing = iota UpdateTip_ToUpdate UpdateTip_Updating UpdateTip_Updated )
View Source
const ( WdPkgsListingManner_general = "general" WdPkgsListingManner_promoted = "promoted" WdPkgsListingManner_solo = "solo" SourceReadingStyle_plain = "plain" SourceReadingStyle_highlight = "highlight" SourceReadingStyle_rich = "rich" SourceReadingStyle_external = "external" // auto detect project hosting URL )
View Source
const ( ResTypeNone pageResType = "" ResTypeAPI pageResType = "api" ResTypeModule pageResType = "mod" ResTypePackage pageResType = "pkg" ResTypeDependency pageResType = "dep" ResTypeImplementation pageResType = "imp" ResTypeSource pageResType = "src" ResTypeReference pageResType = "use" ResTypeCSS pageResType = "css" ResTypeJS pageResType = "jvs" ResTypeSVG pageResType = "svg" ResTypePNG pageResType = "png" )
View Source
const ( DotMStyle_Unexported = -1 DotMStyle_NotShow = 0 DotMStyle_Exported = 1 )
View Source
const ( Phase_Unprepared = iota Phase_Analyzed )
View Source
const DurationToUpdate = time.Hour * 24 * 128
View Source
const MainPkgArrowCharCount = 1
View Source
const PkgDocArrowCharCount = 1
View Source
const Size = 1024 * 1024
Variables ¶
View Source
var ( BoldTagStart = []byte("<b>") BoldTagEnd = []byte("</b>") )
View Source
var (
StarSlash = []byte("*/")
)
View Source
var UpdateTip2DivID = []string{ UpdateTip_Nothing: "", UpdateTip_ToUpdate: "to-update", UpdateTip_Updating: "updating", UpdateTip_Updated: "updated", }
Functions ¶
func DotDotSlashes ¶
func GenTestData ¶
func GoldsUpdateGoSubCommand ¶ added in v0.1.8
func ImprovePackagesForListing ¶
func ImprovePackagesForListing(pkgs []*PackageForListing)
func NewHtmlPage ¶
func NewHtmlPage(goldsVersion, title string, theme Theme, translation Translation, currentPageInfo pagePathInfo) *htmlPage
func ParseGoVersion ¶ added in v0.1.8
func PreviousVersion ¶
Return "" for invalid. Assume the digits of major/minor/patch are all from 0 to 9.
func RelativePath ¶
Types ¶
type BuildSourceLinkFunc ¶ added in v0.2.7
type ChanCommOprator ¶
type ChanCommOprator struct {
// contains filtered or unexported fields
}
func (*ChanCommOprator) End ¶
func (ccp *ChanCommOprator) End() token.Pos
func (*ChanCommOprator) Pos ¶
func (ccp *ChanCommOprator) Pos() token.Pos
type CodeHost ¶ added in v0.2.7
type CodeHost struct { ModulePathPrefix string // RepositryCharacteristics and GuessRepositryFromSourceURL should be both blank or both non-blank. // If it is not blank, the first one in it must be a prefix starting with "https://". // Others are character substrings. RepositryCharacteristics []string // If len(RepositryCharacteristics) > 0, prefix == RepositryCharacteristics[0]. // And url is prefixed with prefix. GuessRepositryFromSourceURL func(url, prefix string) (repo string, extra string) GuessRepositoryFromModulePath func(modulePath string) (repo string, extra string) // Only for the hosts which RepositryCharacteristics[0] is available. BuildSourceLink BuildSourceLinkFunc }
type ContentPool ¶
type ContentPool struct {
// contains filtered or unexported fields
}
type KeywordToken ¶
type KeywordToken struct {
// contains filtered or unexported fields
}
see https://groups.google.com/forum/#!topic/golang-tools/PaJBT2WjEPQ
func (*KeywordToken) End ¶
func (kw *KeywordToken) End() token.Pos
func (*KeywordToken) Pos ¶
func (kw *KeywordToken) Pos() token.Pos
type LoadingLogMessage ¶
type MethodImplementations ¶
type MethodImplementations struct { Method *code.Selector Implementations []MethodInfo }
type MethodInfo ¶
type MethodInfo struct { Method *code.Selector Receiver *TypeForListing Explicit bool // whether or not the method is explicit Interface bool // whether or not the Owner is an interface type }
type ObjectReferences ¶
type Overview ¶
type Overview struct { Packages []*PackageForListing code.Stats }
type PackageDependencyInfo ¶
type PackageDependencyInfo struct { Name string ImportPath string Index int Imports []*PackageForListing ImportedBys []*PackageForListing }
type PackageDetails ¶
type PackageDetails struct { Package *code.Package IsStandard bool Index int Name string ImportPath string NumDeps uint32 NumDepedBys uint32 Files []FileInfo //TypeNames []*TypeDetails TypeNames []ResourceWithPosition ////ValueResources []code.ValueResource //Functions []code.ValueResource //Variables []code.ValueResource //Constants []code.ValueResource Functions []ResourceWithPosition Variables []ResourceWithPosition Constants []ResourceWithPosition NumExportedTypeNames uint32 NumExportedFunctions uint32 NumExportedVariables uint32 NumExportedConstants uint32 // ToDo: use go/doc //IntroductionCode template.HTML Examples []*doc.Example ExampleFileSet *token.FileSet }
type PackageForListing ¶
type PackageForListing struct { Package *code.Package Index int Name string Path string // blank for not analyzed yet Prefix string // the part shared with the last one in list Remaining string // the part different from the last one in list Module string // module path OneLineDoc string NumImportedBys int32 DepHeight int32 DepDepth int32 // The value mains how close to main pacakges. LOC int32 //IsStandard bool InWorkingDirectory bool }
type PageOutputOptions ¶ added in v0.1.8
type PageOutputOptions struct { GoldsVersion string PreferredLang string NoStatistics bool NoIdentifierUsesPages bool NotCollectUnexporteds bool AllowNetworkConnection bool VerboseLogs bool RenderDocLinks bool UnfoldAllInitially bool SourceReadingStyle string WdPkgsListingManner string Theme string }
type ReferencesResult ¶
type ResourceWithPosition ¶ added in v0.2.0
type ResourceWithPosition struct { Position token.Position FileIndex int32 // -1 means owner file not found Offset int32 //Res code.Resource // Use the following two instead of the above one to avoid // 1. change much code // 2. too many type assertions Type *TypeDetails // for PackageDetails.TypeNames only. Alway nil for FileInfo. Value code.ValueResource // also for TypeNames in FileInfo }
type SelectorForListing ¶ added in v0.2.0
type SourceFileAnalyzeResult ¶
type TestData_Package ¶
type TestData_Package struct { Types map[string]TestData_Type VarNames []string ConstNames []string FuncNames []string }
type TestData_Type ¶
type Translation ¶
type Translation interface { Name() string LangTag() string // common Text_Space() string Text_Comma() string Text_Colon(atLineEnd bool) string Text_Period(paragraphEnd bool) string Text_Parenthesis(close bool) string Text_EnclosedInOarentheses(text string) string Text_PreferredFontList() string // server Text_Server_Started() string // analyzing Text_Analyzing() string Text_AnalyzingRefresh(currentPageURL string) string // also used in other pages Text_Analyzing_Start() string Text_Analyzing_Done(d time.Duration, memoryUse string) string Text_Analyzing_PreparationDone(d time.Duration) string // ToDo: merge these into one? Text_Analyzing_NFilesParsed(numFiles int, d time.Duration) string Text_Analyzing_ParsePackagesDone(numFiles int, d time.Duration) string Text_Analyzing_CollectPackages(numMods int, d time.Duration) string Text_Analyzing_CollectModules(numPkgs int, d time.Duration) string Text_Analyzing_CollectExamples(d time.Duration) string Text_Analyzing_SortPackagesByDependencies(d time.Duration) string Text_Analyzing_CollectDeclarations(d time.Duration) string Text_Analyzing_CollectRuntimeFunctionPositions(d time.Duration) string //Text_Analyzing_ConfirmTypeSources(d time.Duration) string Text_Analyzing_CollectSelectors(d time.Duration) string Text_Analyzing_FindImplementations(d time.Duration) string Text_Analyzing_RegisterInterfaceMethodsForTypes(d time.Duration) string Text_Analyzing_MakeStatistics(d time.Duration) string Text_Analyzing_CollectSourceFiles(d time.Duration) string Text_Analyzing_CollectObjectReferences(d time.Duration) string Text_Analyzing_CacheSourceFiles(d time.Duration) string // overview page Text_Overview() string Text_PackageList() string Text_StatisticsWithMoreLink(detailedStatsLink string) string Text_SimpleStats(stats *code.Stats) string Text_Modules() string // to use Text_BelongingModule() string // to use Text_RequireStat(numRequires, numRequiredBys int) string // to use Text_UpdateTip(tipName string) string // tip names: "ToUpdate", "Updating", "Updated" Text_SortBy(whatToSort string) string // also used in other pages Text_SortByItem(by string) string // also used in other pages // package details page Text_Package(pkgPath string) string Text_BelongingPackage() string // also used in source code page Text_PackageDocsLinksOnOtherWebsites(pkgPath string, isStdPkg bool) string Text_ImportPath() string Text_ImportStat(numImports, numImportedBys int, depPageURL string) string Text_InvolvedFiles(num int) string Text_Examples(num int) string Text_PackageLevelTypeNames() string Text_TypeParameters() string //Text_AllPackageLevelValues(num int) string Text_PackageLevelFunctions() string Text_PackageLevelVariables() string Text_PackageLevelConstants() string Text_PackageLevelResourceSimpleStat(statsAreExact bool, num, numExporteds int, mentionExporteds bool) string Text_UnexportedResourcesHeader(show bool, numUnexporteds int, exact bool) string Text_ListUnexportes() string Text_BasicType() string Text_Fields() string // ToDo: merge these into one? Text_Methods() string Text_ImplementedBy() string Text_Implements() string Text_AsOutputsOf() string Text_AsInputsOf() string Text_AsTypesOf() string // package dependencies page Text_DependencyRelations(pkgPath string) string // also used in package details page with a blank argument. Text_Imports() string Text_ImportedBy() string // method implementation page Text_MethodImplementations() string Text_NumMethodsImplementingNothing(count int) string Text_ViewMethodImplementations() string // object references(uses) page Text_ReferenceList() string Text_CurrentPackage() string Text_ObjectKind(kind string) string Text_ObjectUses(num int) string // also used in other pages // source code page Text_SourceCode(pkgPath, bareFilename string) string Text_SourceFilePath() string Text_GeneratedFrom() string // statistics Text_Statistics() string Text_ChartTitle(chartName string) string Text_StatisticsTitle(titleName string) string Text_PackageStatistics(values map[string]interface{}) []string Text_TypeStatistics(values map[string]interface{}) []string Text_ValueStatistics(values map[string]interface{}) []string Text_Othertatistics(values map[string]interface{}) []string // Footer }
type TypeDetails ¶ added in v0.2.0
type TypeDetails struct { TypeName *code.TypeName AllListsAreBlank bool Popularity int Aliases []*TypeForListing // excluding self if self is an alias. Fields []*SelectorForListing // []*code.Selector Methods []*code.Selector NumExportedFields int32 NumExportedMethods int32 ImplementedBys []*TypeForListing Implements []*TypeForListing NumExportedImpedBys int32 NumExportedImpls int32 AsInputsOf []*ValueForListing AsOutputsOf []*ValueForListing NumExportedAsInputsOfs int32 NumExportedAsOutputsOfs int32 Values []*ValueForListing NumExportedValues int32 }
type TypeForListing ¶
type ValueForListing ¶
type ValueForListing struct { code.ValueResource InCurrentPkg bool CommonPath string }
Source Files ¶
- 1.18+.go
- api_load.go
- api_update.go
- info_module.go
- page.go
- page_css.go
- page_identifier-references.go
- page_javascript.go
- page_method-implementation.go
- page_module.go
- page_overview.go
- page_package-dependencies.go
- page_package-details.go
- page_png.go
- page_source-code.go
- page_statistics.go
- page_svg.go
- res.go
- server.go
- tool_gen-docs.go
- tool_gen-testdata.go
Click to show internal directories.
Click to hide internal directories.