blob: eb6bfa3faa48e776059ec298b2c4792a319c6a05 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syncbaselib
import (
"flag"
)
type Opts struct {
Name string
RootDir string
Engine string
SkipPublishInNh bool
DevMode bool
CpuProfile string
}
// Note: Where possible, we have flag default values be zero values, so that
// struct-based configuration matches flag-based configuration.
func (o *Opts) InitFlags(f *flag.FlagSet) {
f.StringVar(&o.Name, "name", "", "Name to mount at.")
f.StringVar(&o.RootDir, "root-dir", "", "Root dir for data storage. If empty, we write to a fresh directory created using ioutil.TempDir.")
f.StringVar(&o.Engine, "engine", "", "Storage engine to use: memstore or leveldb. If empty, we use the default storage engine, currently leveldb.")
f.BoolVar(&o.SkipPublishInNh, "skip-publish-in-nh", false, "Whether to skip publishing in the neighborhood.")
f.BoolVar(&o.DevMode, "dev", false, "Whether to run in development mode; required for RPCs such as Service.DevModeUpdateVClock.")
f.StringVar(&o.CpuProfile, "cpuprofile", "", "If specified, write the cpu profile to the given filename.")
}