예제 #1
0
func init() {
	drivers.Register(CassandraDriverName, &drivers.RegisteredDriver{
		New: newCassandraDriver,
		Flags: []cli.Flag{
			cli.StringFlag{Name: "cassandra-hosts", Value: "192.168.99.100", Usage: "Cassandra hosts", EnvVar: "CASSANDRA_HOSTS"},
			cli.StringFlag{Name: "cassandra-keyspace", Value: "otsimo", Usage: "Cassandra keyspace"},
			cli.IntFlag{Name: "cassandra-port", Value: 9042, Usage: "Cassandra Port"},
		},
	})
}
예제 #2
0
파일: mongodb.go 프로젝트: otsimo/listener
func init() {
	drivers.Register(MongoDBDriverName, &drivers.RegisteredDriver{
		New: newMongoDriver,
		Flags: []cli.Flag{
			cli.StringFlag{Name: mongoUrlFlag, Value: "localhost:27017", Usage: "Mongodb url", EnvVar: "MONGODB_URL"},
			cli.StringFlag{Name: mongoDBFlag, Value: "Otsimo", Usage: "Database name to insert values", EnvVar: "MONGODB_DB"},
			cli.BoolFlag{Name: mongoAuthFlag, Usage: "Is Mongodb auth active", EnvVar: "MONGODB_AUTH"},
			cli.StringFlag{Name: mongoUserFlag, Usage: "Database username", EnvVar: "MONGODB_USER"},
			cli.StringFlag{Name: mongoPasswordFlag, Usage: "Database password", EnvVar: "MONGODB_PASSWORD"},
		},
	})
}