GoPLS Viewer

Home|gopls/godoc/analysis/json.go
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
5package analysis
6
7// This file defines types used by client-side JavaScript.
8
9type 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 == "")
17type implFactJSON struct {
18    ByKind string `json:",omitempty"`
19    Other  anchorJSON
20}
21
22// Implements facts are grouped by form, for ease of reading.
23type implGroupJSON struct {
24    Descr string
25    Facts []implFactJSON
26}
27
28// JavaScript's onClickIdent() expects a TypeInfoJSON.
29type TypeInfoJSON struct {
30    Name        string // type name
31    SizeAlign 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".
39type PCGNodeJSON struct {
40    Func    anchorJSON
41    Callees []int // indices within CALLGRAPH of nodes called by this one
42}
43
MembersX
anchorJSON.Text
anchorJSON.Href
implGroupJSON.Facts
TypeInfoJSON.Size
TypeInfoJSON.Align
TypeInfoJSON.Methods
PCGNodeJSON.Func
PCGNodeJSON.Callees
anchorJSON
implFactJSON
implFactJSON.Other
implGroupJSON
TypeInfoJSON
TypeInfoJSON.ImplGroups
implFactJSON.ByKind
implGroupJSON.Descr
TypeInfoJSON.Name
PCGNodeJSON
Members
X