github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/godoc/analysis/json.go (about)

     1  // Copyright 2014 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package analysis
     6  
     7  // This file defines types used by client-side JavaScript.
     8  
     9  type anchorJSON struct {
    10  	Text string // HTML
    11  	Href string // URL
    12  }
    13  
    14  // Indicates one of these forms of fact about a type T:
    15  // T "is implemented by <ByKind> type <Other>"  (ByKind != "", e.g. "array")
    16  // T "implements <Other>"                       (ByKind == "")
    17  type implFactJSON struct {
    18  	ByKind string `json:",omitempty"`
    19  	Other  anchorJSON
    20  }
    21  
    22  // Implements facts are grouped by form, for ease of reading.
    23  type implGroupJSON struct {
    24  	Descr string
    25  	Facts []implFactJSON
    26  }
    27  
    28  // JavaScript's onClickIdent() expects a TypeInfoJSON.
    29  type TypeInfoJSON struct {
    30  	Name        string // type name
    31  	Size, Align int64
    32  	Methods     []anchorJSON
    33  	ImplGroups  []implGroupJSON
    34  }
    35  
    36  // JavaScript's cgAddChild requires a global array of PCGNodeJSON
    37  // called CALLGRAPH, representing the intra-package call graph.
    38  // The first element is special and represents "all external callers".
    39  type PCGNodeJSON struct {
    40  	Func    anchorJSON
    41  	Callees []int // indices within CALLGRAPH of nodes called by this one
    42  }