Пример #1
0
// Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0

package main

import (
	"fmt"

	"github.com/attic-labs/noms/go/chunks"
	"github.com/attic-labs/noms/go/d"
	flag "github.com/tsuru/gnuflag"
)

var (
	portFlag    = flag.Int("port", 8000, "port to listen on")
	ldbDir      = flag.String("ldb-dir", "", "directory for ldb database")
	authKeyFlag = flag.String("authkey", "", "token to use for authenticating write operations")
)

func usage() {
	fmt.Println("Usage: demo-server -authkey <authkey> [options]")
	flag.PrintDefaults()
}

func main() {
	chunks.RegisterLevelDBFlags(flag.CommandLine)
	dynFlags := chunks.DynamoFlags("")

	flag.Usage = usage
	flag.Parse(true)
Пример #2
0
	"strings"

	"github.com/attic-labs/noms/go/chunks"
	"github.com/attic-labs/noms/go/constants"
	"github.com/attic-labs/noms/go/d"
	"github.com/attic-labs/noms/go/datas"
	"github.com/julienschmidt/httprouter"
	flag "github.com/tsuru/gnuflag"
)

const (
	dsPathPrefix = "/-ds"
)

var (
	portFlag = flag.Int("port", 0, "Port to listen on")
)

type chunkStoreRecord struct {
	cs    chunks.ChunkStore
	alias string
}

type chunkStoreRecords map[string]chunkStoreRecord

func main() {
	usage := func() {
		fmt.Fprintln(os.Stderr, "Usage: noms ui [-host HOST] directory [args...]\n")
		fmt.Fprintln(os.Stderr, "  args are of the form arg1=val1, arg2=val2, etc. \"ldb:\" values are automatically translated into paths to an HTTP noms database server.\n")
		flag.PrintDefaults()
	}