github.com/pbberlin/tools@v0.0.0-20160910141205-7aa5421c2169/appengine/backend/backend3_structs.go (about)

     1  package backend
     2  
     3  // block level root
     4  type B0 struct {
     5  	NColsViewport int // either NCols or NRows determines the other value
     6  	NumXSectors   int
     7  	NumYSectors   int
     8  	VB1           []B1
     9  	NumB1         int
    10  	NumB2         int
    11  
    12  	MaxNCols int
    13  	MaxNRows int
    14  }
    15  
    16  // block level 1
    17  type B1 struct {
    18  	Heading        string
    19  	VB2            []B2  // editorial sorting - as ordered by the editor
    20  	BySize         ByInt // sorted by Number of Characters
    21  	ByHeading      ByStr // alphabetically sorted
    22  	NCols          int   // either NCols or NRows determines the other value
    23  	NColsEditorial int   // fixed by editor
    24  	NRows          int   // NRows := len(VB2) / NCols ; if len(VB2) % NCols != 0 {NRows++}
    25  	Discrepancy    int   // NRows*NCols - len(VB2)
    26  	StartNewRow    bool
    27  
    28  	//OrderedBySize []B2 // obsolete
    29  }
    30  
    31  type B2 struct {
    32  	Linktext       string
    33  	Url            string
    34  	Target         string
    35  	Description    string
    36  	IsFirst        bool
    37  	IsLast         bool
    38  	Size           int
    39  	EditorialIndex int // for referral from a sorted helper array
    40  }
    41  
    42  var X = []B1{
    43  	B1{
    44  		Heading:        "Diverse",
    45  		NColsEditorial: 4,
    46  		VB2: []B2{
    47  			B2{Linktext: "Login", Url: "/login"},
    48  			B2{Linktext: "Schreib-Methoden", Url: "/write-methods", Description: "FPrintf, bytes.Buffer, io.WriteString and others"},
    49  			B2{Linktext: "Letzte Email", Url: "/email-view"},
    50  			B2{Linktext: "Blob List", Url: "/blob/list"},
    51  			B2{Linktext: "Template Demo 1", Url: "/tpl/demo1"},
    52  			B2{Linktext: "Template Demo 2", Url: "/tpl/demo2"},
    53  			B2{Linktext: "Http fetch", Url: "/fetch-url"},
    54  			B2{Linktext: "Instance Info", Url: "/instance-info/view"},
    55  			B2{Linktext: "Gob encode decode", Url: "/big-query/test-gob-codec"},
    56  
    57  			B2{Linktext: "JSON encode", Url: "/json-encode"},
    58  			B2{Linktext: "JSON decode", Url: "/json-decode"},
    59  
    60  			B2{Linktext: "Fulltext put", Url: "/fulltext-search/put"},
    61  			B2{Linktext: "Fulltext get", Url: "/fulltext-search/get"},
    62  		},
    63  	},
    64  
    65  	B1{
    66  		Heading:     "Guestbook",
    67  		StartNewRow: false,
    68  		VB2: []B2{
    69  			B2{Linktext: "Neuer Eintrag", Url: "/guest-entry"},
    70  			B2{Linktext: "Einträge auflisten", Url: "/guest-view"},
    71  			B2{Linktext: "Einträge auflisten - paged - serialized cursor", Url: "/guest-view-cursor"},
    72  		},
    73  	},
    74  	B1{
    75  		Heading: "Drawing",
    76  		VB2: []B2{
    77  			B2{Linktext: "Drawing a static chart", Url: "/image/draw-lines-example"},
    78  		},
    79  	},
    80  	B1{
    81  		Heading:     "Big Query",
    82  		StartNewRow: true,
    83  		VB2: []B2{
    84  			B2{Linktext: "Get real data", Url: "/big-query/query-into-datastore"},
    85  			B2{Linktext: "Get mocked data", Url: "/big-query/mock-data-into-datastore"},
    86  		},
    87  	},
    88  	B1{
    89  		Heading:     "... with Chart",
    90  		StartNewRow: false,
    91  		VB2: []B2{
    92  			B2{Linktext: "Process Data 1 (mock=1},", Url: "/big-query/regroup-data-01?mock=0"},
    93  			B2{Linktext: "Process Data 2", Url: "/big-query/regroup-data-02?f=table"},
    94  			B2{Linktext: "Show as Table", Url: "/big-query/show-table"},
    95  			B2{Linktext: "Show as Chart", Url: "/big-query/show-chart"},
    96  			B2{Linktext: "As HTML", Url: "/big-query/html"},
    97  		},
    98  	},
    99  	B1{
   100  		Heading: "Request Images",
   101  		VB2: []B2{
   102  			B2{Linktext: "WrapBlob from Datastore", Url: "/image/img-from-datastore?p=chart1"},
   103  			B2{Linktext: "base64 from Datastore", Url: "/image/base64-from-datastore?p=chart1"},
   104  			B2{Linktext: "base64 from Variable", Url: "/image/base64-from-var?p=1"},
   105  			B2{Linktext: "base64 from File", Url: "/image/base64-from-file?p=static/pberg1.png"},
   106  		},
   107  	},
   108  	B1{
   109  		Heading: "Namespaces and Task Queues",
   110  		VB2: []B2{
   111  			B2{Linktext: "Increment", Url: "/namespaced-counters/increment"},
   112  			B2{Linktext: "Read", Url: "/namespaced-counters/read"},
   113  			B2{Linktext: "Push to task-queue", Url: "/namespaced-counters/queue-push"},
   114  		},
   115  	},
   116  	B1{
   117  		Heading: "URLs with/without Ancestors",
   118  		VB2: []B2{
   119  			B2{Linktext: "Add without ancestor", Url: "/save-url/save-no-anc"},
   120  			B2{Linktext: "Add <b>with</b> ancestor", Url: "/save-url/save-wi-anc"},
   121  			B2{Linktext: "Query without ancestor", Url: "/save-url/view-no-anc"},
   122  			B2{Linktext: "Query <b>with</b> ancestor", Url: "/save-url/view-wi-anc"},
   123  			B2{Linktext: "Query URL Backend", Url: "/save-url/backend"},
   124  		},
   125  	},
   126  	B1{
   127  		Heading: "x",
   128  		VB2:     []B2{},
   129  	},
   130  }
   131  
   132  func init() {
   133  
   134  }