spannerz

package
v0.0.0-...-3fb59ca Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Example
package main

import (
	"context"
	"log"
	"net/http"

	"cloud.google.com/go/spanner"
	"github.com/rakyll/spannerz/spannerz"
)

var ctx = context.Background()

func main() {
	client, err := spanner.NewClient(ctx, "projects/PROJECT/instances/SPANNER_INSTANCE/databases/SPANNER_DB")
	if err != nil {
		log.Fatalf("Cannot create Spanner client: %v", err)
	}
	http.Handle("/spannerz", &spannerz.Handler{
		Client: client,
	})
	log.Fatal(http.ListenAndServe(":9090", nil))
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) AddNode

func (g *Graph) AddNode(n *Node)

func (*Graph) LinkByIndex

func (g *Graph) LinkByIndex(from, to int)

func (*Graph) SVG

func (g *Graph) SVG() (string, error)

func (*Graph) String

func (g *Graph) String() string

type Handler

type Handler struct {
	Client *spanner.Client
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IndexData

type IndexData struct {
	Query string
	Stats map[string]string
	Image template.HTML
	Error error
}

type Node

type Node struct {
	ID      int
	Name    string
	Latency time.Duration
	CPUTime time.Duration
	Attrs   map[string]string
}

Jump to

Keyboard shortcuts

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