Skip to content

Commit

Permalink
chore(*): make everything use goven
Browse files Browse the repository at this point in the history
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven  -copy -rewrite $i; done
  • Loading branch information
Brandon Philips committed Feb 2, 2014
1 parent ea8a353 commit 13b6c1e
Show file tree
Hide file tree
Showing 536 changed files with 4,198 additions and 88,354 deletions.
2 changes: 1 addition & 1 deletion bench/bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"strconv"

"github.com/coreos/go-etcd/etcd"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
)

func write(endpoint string, requests int, end chan int) {
Expand Down
2 changes: 1 addition & 1 deletion etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"runtime"
"time"

"github.com/coreos/raft"
"github.com/coreos/etcd/third_party/github.com/coreos/raft"

ehttp "github.com/coreos/etcd/http"
"github.com/coreos/etcd/log"
Expand Down
2 changes: 1 addition & 1 deletion log/log.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package log

import (
golog "github.com/coreos/go-log/log"
golog "github.com/coreos/etcd/third_party/github.com/coreos/go-log/log"
"os"
)

Expand Down
2 changes: 1 addition & 1 deletion metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package metrics
import (
"io"

gometrics "github.com/rcrowley/go-metrics"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)

type Timer gometrics.Timer
Expand Down
2 changes: 1 addition & 1 deletion metrics/nil.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package metrics
import (
"io"

gometrics "github.com/rcrowley/go-metrics"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)

type nilBucket struct{}
Expand Down
22 changes: 11 additions & 11 deletions metrics/standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import (
"sync"
"time"

gometrics "github.com/rcrowley/go-metrics"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)

const (
// RuntimeMemStatsSampleInterval is the interval in seconds at which the
// Go runtime's memory statistics will be gathered.
RuntimeMemStatsSampleInterval = time.Duration(2) * time.Second
RuntimeMemStatsSampleInterval = time.Duration(2) * time.Second

// GraphitePublishInterval is the interval in seconds at which all
// gathered statistics will be published to a Graphite endpoint.
GraphitePublishInterval = time.Duration(2) * time.Second
GraphitePublishInterval = time.Duration(2) * time.Second
)

type standardBucket struct {
sync.Mutex
name string
registry gometrics.Registry
timers map[string]Timer
gauges map[string]Gauge
name string
registry gometrics.Registry
timers map[string]Timer
gauges map[string]Gauge
}

func newStandardBucket(name string) standardBucket {
Expand All @@ -34,10 +34,10 @@ func newStandardBucket(name string) standardBucket {
go gometrics.CaptureRuntimeMemStats(registry, RuntimeMemStatsSampleInterval)

return standardBucket{
name: name,
registry: registry,
timers: make(map[string]Timer),
gauges: make(map[string]Gauge),
name: name,
registry: registry,
timers: make(map[string]Timer),
gauges: make(map[string]Gauge),
}
}

Expand Down
2 changes: 1 addition & 1 deletion mod/leader/v2/delete_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// deleteHandler remove a given leader.
Expand Down
2 changes: 1 addition & 1 deletion mod/leader/v2/get_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"net/http"

"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// getHandler retrieves the current leader.
Expand Down
16 changes: 8 additions & 8 deletions mod/leader/v2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// prefix is appended to the lock's prefix since the leader mod uses the lock mod.
Expand All @@ -13,19 +13,19 @@ const prefix = "/_mod/leader"
// handler manages the leader HTTP request.
type handler struct {
*mux.Router
client *http.Client
transport *http.Transport
addr string
client *http.Client
transport *http.Transport
addr string
}

// NewHandler creates an HTTP handler that can be registered on a router.
func NewHandler(addr string) http.Handler {
transport := &http.Transport{DisableKeepAlives: false}
h := &handler{
Router: mux.NewRouter(),
client: &http.Client{Transport: transport},
transport: transport,
addr: addr,
Router: mux.NewRouter(),
client: &http.Client{Transport: transport},
transport: transport,
addr: addr,
}
h.StrictSlash(false)
h.handleFunc("/{key:.*}", h.getHandler).Methods("GET")
Expand Down
2 changes: 1 addition & 1 deletion mod/leader/v2/set_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// setHandler attempts to set the current leader.
Expand Down
4 changes: 2 additions & 2 deletions mod/lock/v2/acquire_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"

etcdErr "github.com/coreos/etcd/error"
"github.com/coreos/go-etcd/etcd"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// acquireHandler attempts to acquire a lock on the given key.
Expand Down
2 changes: 1 addition & 1 deletion mod/lock/v2/get_index_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// getIndexHandler retrieves the current lock index.
Expand Down
10 changes: 5 additions & 5 deletions mod/lock/v2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import (
"net/http"

etcdErr "github.com/coreos/etcd/error"
"github.com/coreos/go-etcd/etcd"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

const prefix = "/_etcd/mod/lock"

// handler manages the lock HTTP request.
type handler struct {
*mux.Router
client *etcd.Client
client *etcd.Client
}

// NewHandler creates an HTTP handler that can be registered on a router.
func NewHandler(addr string) http.Handler {
h := &handler{
Router: mux.NewRouter(),
client: etcd.NewClient([]string{addr}),
Router: mux.NewRouter(),
client: etcd.NewClient([]string{addr}),
}
h.StrictSlash(false)
h.handleFunc("/{key:.*}", h.getIndexHandler).Methods("GET")
Expand Down
2 changes: 1 addition & 1 deletion mod/lock/v2/lock_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"strconv"

"github.com/coreos/go-etcd/etcd"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
)

// lockNodes is a wrapper for go-etcd's Nodes to allow for sorting by numeric key.
Expand Down
2 changes: 1 addition & 1 deletion mod/lock/v2/release_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// releaseLockHandler deletes the lock.
Expand Down
2 changes: 1 addition & 1 deletion mod/lock/v2/renew_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

etcdErr "github.com/coreos/etcd/error"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

// renewLockHandler attempts to update the TTL on an existing lock.
Expand Down
2 changes: 1 addition & 1 deletion mod/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/coreos/etcd/mod/dashboard"
leader2 "github.com/coreos/etcd/mod/leader/v2"
lock2 "github.com/coreos/etcd/mod/lock/v2"
"github.com/gorilla/mux"
"github.com/coreos/etcd/third_party/github.com/gorilla/mux"
)

var ServeMux *http.Handler
Expand Down
120 changes: 60 additions & 60 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strconv"
"strings"

"github.com/BurntSushi/toml"
"github.com/coreos/etcd/third_party/github.com/BurntSushi/toml"
"github.com/coreos/etcd/log"
)

Expand All @@ -22,63 +22,63 @@ const DefaultSystemConfigPath = "/etc/etcd/etcd.conf"

// A lookup of deprecated flags to their new flag name.
var newFlagNameLookup = map[string]string{
"C": "peers",
"CF": "peers-file",
"n": "name",
"c": "addr",
"cl": "bind-addr",
"s": "peer-addr",
"sl": "peer-bind-addr",
"d": "data-dir",
"m": "max-result-buffer",
"r": "max-retry-attempts",
"maxsize": "max-cluster-size",
"clientCAFile": "ca-file",
"clientCert": "cert-file",
"clientKey": "key-file",
"serverCAFile": "peer-ca-file",
"serverCert": "peer-cert-file",
"serverKey": "peer-key-file",
"snapshotCount": "snapshot-count",
"C": "peers",
"CF": "peers-file",
"n": "name",
"c": "addr",
"cl": "bind-addr",
"s": "peer-addr",
"sl": "peer-bind-addr",
"d": "data-dir",
"m": "max-result-buffer",
"r": "max-retry-attempts",
"maxsize": "max-cluster-size",
"clientCAFile": "ca-file",
"clientCert": "cert-file",
"clientKey": "key-file",
"serverCAFile": "peer-ca-file",
"serverCert": "peer-cert-file",
"serverKey": "peer-key-file",
"snapshotCount": "snapshot-count",
}

// Config represents the server configuration.
type Config struct {
SystemPath string

Addr string `toml:"addr" env:"ETCD_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_CERT_FILE"`
CPUProfileFile string
CorsOrigins []string `toml:"cors" env:"ETCD_CORS"`
DataDir string `toml:"data_dir" env:"ETCD_DATA_DIR"`
Force bool
KeyFile string `toml:"key_file" env:"ETCD_KEY_FILE"`
Peers []string `toml:"peers" env:"ETCD_PEERS"`
PeersFile string `toml:"peers_file" env:"ETCD_PEERS_FILE"`
MaxClusterSize int `toml:"max_cluster_size" env:"ETCD_MAX_CLUSTER_SIZE"`
MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"`
MaxRetryAttempts int `toml:"max_retry_attempts" env:"ETCD_MAX_RETRY_ATTEMPTS"`
Name string `toml:"name" env:"ETCD_NAME"`
Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"`
SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"`
ShowHelp bool
ShowVersion bool
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
VeryVeryVerbose bool `toml:"very_very_verbose" env:"ETCD_VERY_VERY_VERBOSE"`
Peer struct {
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_PEER_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_PEER_CERT_FILE"`
KeyFile string `toml:"key_file" env:"ETCD_PEER_KEY_FILE"`
HeartbeatTimeout int `toml:"heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
ElectionTimeout int `toml:"election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
}
strTrace string `toml:"trace" env:"ETCD_TRACE"`
GraphiteHost string `toml:"graphite_host" env:"ETCD_GRAPHITE_HOST"`
SystemPath string

Addr string `toml:"addr" env:"ETCD_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_CERT_FILE"`
CPUProfileFile string
CorsOrigins []string `toml:"cors" env:"ETCD_CORS"`
DataDir string `toml:"data_dir" env:"ETCD_DATA_DIR"`
Force bool
KeyFile string `toml:"key_file" env:"ETCD_KEY_FILE"`
Peers []string `toml:"peers" env:"ETCD_PEERS"`
PeersFile string `toml:"peers_file" env:"ETCD_PEERS_FILE"`
MaxClusterSize int `toml:"max_cluster_size" env:"ETCD_MAX_CLUSTER_SIZE"`
MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"`
MaxRetryAttempts int `toml:"max_retry_attempts" env:"ETCD_MAX_RETRY_ATTEMPTS"`
Name string `toml:"name" env:"ETCD_NAME"`
Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"`
SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"`
ShowHelp bool
ShowVersion bool
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
VeryVeryVerbose bool `toml:"very_very_verbose" env:"ETCD_VERY_VERY_VERBOSE"`
Peer struct {
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_PEER_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_PEER_CERT_FILE"`
KeyFile string `toml:"key_file" env:"ETCD_PEER_KEY_FILE"`
HeartbeatTimeout int `toml:"heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
ElectionTimeout int `toml:"election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
}
strTrace string `toml:"trace" env:"ETCD_TRACE"`
GraphiteHost string `toml:"graphite_host" env:"ETCD_GRAPHITE_HOST"`
}

// NewConfig returns a Config initialized with default values.
Expand Down Expand Up @@ -433,9 +433,9 @@ func (c *Config) Sanitize() error {
// TLSInfo retrieves a TLSInfo object for the client server.
func (c *Config) TLSInfo() TLSInfo {
return TLSInfo{
CAFile: c.CAFile,
CertFile: c.CertFile,
KeyFile: c.KeyFile,
CAFile: c.CAFile,
CertFile: c.CertFile,
KeyFile: c.KeyFile,
}
}

Expand All @@ -447,9 +447,9 @@ func (c *Config) TLSConfig() (TLSConfig, error) {
// PeerTLSInfo retrieves a TLSInfo object for the peer server.
func (c *Config) PeerTLSInfo() TLSInfo {
return TLSInfo{
CAFile: c.Peer.CAFile,
CertFile: c.Peer.CertFile,
KeyFile: c.Peer.KeyFile,
CAFile: c.Peer.CAFile,
CertFile: c.Peer.CertFile,
KeyFile: c.Peer.KeyFile,
}
}

Expand Down
Loading

0 comments on commit 13b6c1e

Please sign in to comment.