示例#1
0
func TestConfig() *facade.Config {
	if testConfigCached != nil {
		return testConfigCached
	}

	cfg, err := facade.NewConfig(facade.DefaultConfigDir())
	if err != nil {
		log.Fatalf("Failed to load config: %v", err)
	}

	testConfigCached = cfg
	return testConfigCached
}
示例#2
0
文件: main.go 项目: postfix/otaru
	"fmt"
	"log"
	"os"
	"strconv"

	"golang.org/x/net/context"

	"github.com/nyaxt/otaru/btncrypt"
	"github.com/nyaxt/otaru/facade"
	"github.com/nyaxt/otaru/gcloud/auth"
	"github.com/nyaxt/otaru/gcloud/datastore"
	"github.com/nyaxt/otaru/inodedb"
)

var (
	flagConfigDir = flag.String("configDir", facade.DefaultConfigDir(), "Config dirpath")
)

func Usage() {
	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
	fmt.Fprintf(os.Stderr, "  %s [options] purge\n", os.Args[0])
	fmt.Fprintf(os.Stderr, "  %s [options] query [minID]\n", os.Args[0])
	flag.PrintDefaults()
}

func main() {
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)

	flag.Usage = Usage
	flag.Parse()
示例#3
0
文件: main.go 项目: postfix/otaru
import (
	"flag"
	"fmt"
	"io"
	"log"
	"os"
	"path"

	"github.com/nyaxt/otaru/btncrypt"
	"github.com/nyaxt/otaru/chunkstore"
	"github.com/nyaxt/otaru/facade"
	"github.com/nyaxt/otaru/util"
)

var (
	flagPasswordFile = flag.String("passwordFile", path.Join(facade.DefaultConfigDir(), "password.txt"), "Path of a text file storing password")
	flagHeader       = flag.Bool("header", false, "Show header")
)

func Usage() {
	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
	fmt.Fprintf(os.Stderr, "  %s OTARU_BLOBFILE\n", os.Args[0])
	flag.PrintDefaults()
}

func main() {
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)

	flag.Usage = Usage
	flag.Parse()