sync_gateway_admin_ui

package module
v0.0.0-...-93c74ba Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Apache-2.0 Imports: 9 Imported by: 2

README

NOTE: development on this has stopped and moved to the dev branch which is a re-write from scratch!

Developer Console for Couchbase Sync Gateway

This is not a standalone project -- it's a submodule of the Couchbase Sync Gateway. We are keeping it in a separate repository so that its Git commits and Github issues are separated from the main gateway's, for clarity. In addition, this project is currently in an early development and experimental phase. The resulting dashboard will change drastically in the near future.

This project contains the Web assets for the Sync Gateway's admin console. To use this interface, launch a Sync Gateway server and visit http://localhost:4985/_admin/ in your browser. (This port is bound to localhost-only by default, so if you want to connect to it from a remote device you may need to create a tunnel or change your gateway config.)

What can you do with it?

  • View and edit your Sync Function code and see what it will do before you deploy it
  • Browse through all databases and their documents
  • View the JSON contents of any document, plus its channel assignments and any channel access it grants
  • View the internal _sync metadata of any document (useful mostly for troubleshooting the Sync Gateway)

Known Issues

Currently it tries to load the last 1000 changes into the brower's memory. If you have more than 1000 documents in your database it will only look at the 1000 most recent. In the future we will make this configurable.

Developing / Contributing

NOTE: To use the existing admin UI you don't need to do anything with this repository; it's already built into the Sync Gateway. You only need to follow these instructions if you want to make changes to the admin UI.

Before you can work on this code, you need node.js installed locally. Once you have that, run these commands.

	cd src/github.com/couchbaselabs/sync_gateway_admin_ui
	npm install -g grunt-cli   # you might need to sudo this
	npm install -g tap         # ditto
	npm install
	grunt

You'll need to run grunt every time you change code files. You can also run it continuously with grunt watch.

To point Sync Gateway at the development bundle created by grunt, add this line to your Sync Gateway config file at the top level:

	"adminUI" : "src/github.com/couchbaselabs/sync_gateway_admin_ui/assets/index.html",

Building for Release

To release this code for consumption by Sync Gateway's build process, it needs to be packaged as Go code:

    go get github.com/jteeuwen/go-bindata
    grunt
    ./bundle.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

This section is empty.

Jump to

Keyboard shortcuts

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