server/embed: address golangci var-naming issues
Addresses issues in TLSMinVersion, TLSMaxVersion, WALDir, and MaxWALFiles. Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
parent
e37a67e40b
commit
0a1bc1208f
@ -151,6 +151,7 @@ func init() {
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Dir string `json:"data-dir"`
|
Dir string `json:"data-dir"`
|
||||||
|
//revive:disable-next-line:var-naming
|
||||||
WalDir string `json:"wal-dir"`
|
WalDir string `json:"wal-dir"`
|
||||||
|
|
||||||
SnapshotCount uint64 `json:"snapshot-count"`
|
SnapshotCount uint64 `json:"snapshot-count"`
|
||||||
@ -163,6 +164,7 @@ type Config struct {
|
|||||||
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`
|
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`
|
||||||
|
|
||||||
MaxSnapFiles uint `json:"max-snapshots"`
|
MaxSnapFiles uint `json:"max-snapshots"`
|
||||||
|
//revive:disable-next-line:var-naming
|
||||||
MaxWalFiles uint `json:"max-wals"`
|
MaxWalFiles uint `json:"max-wals"`
|
||||||
|
|
||||||
// TickMs is the number of milliseconds between heartbeat ticks.
|
// TickMs is the number of milliseconds between heartbeat ticks.
|
||||||
@ -231,8 +233,11 @@ type Config struct {
|
|||||||
CipherSuites []string `json:"cipher-suites"`
|
CipherSuites []string `json:"cipher-suites"`
|
||||||
|
|
||||||
// TlsMinVersion is the minimum accepted TLS version between client/server and peers.
|
// TlsMinVersion is the minimum accepted TLS version between client/server and peers.
|
||||||
|
//revive:disable-next-line:var-naming
|
||||||
TlsMinVersion string `json:"tls-min-version"`
|
TlsMinVersion string `json:"tls-min-version"`
|
||||||
|
|
||||||
// TlsMaxVersion is the maximum accepted TLS version between client/server and peers.
|
// TlsMaxVersion is the maximum accepted TLS version between client/server and peers.
|
||||||
|
//revive:disable-next-line:var-naming
|
||||||
TlsMaxVersion string `json:"tls-max-version"`
|
TlsMaxVersion string `json:"tls-max-version"`
|
||||||
|
|
||||||
ClusterState string `json:"initial-cluster-state"`
|
ClusterState string `json:"initial-cluster-state"`
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func isMemberInitialized(cfg *Config) bool {
|
func isMemberInitialized(cfg *Config) bool {
|
||||||
waldir := cfg.WalDir
|
walDir := cfg.WalDir
|
||||||
if waldir == "" {
|
if walDir == "" {
|
||||||
waldir = filepath.Join(cfg.Dir, "member", "wal")
|
walDir = filepath.Join(cfg.Dir, "member", "wal")
|
||||||
}
|
}
|
||||||
return wal.Exist(waldir)
|
return wal.Exist(walDir)
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ func TestConfigFileMemberFields(t *testing.T) {
|
|||||||
yc := struct {
|
yc := struct {
|
||||||
Dir string `json:"data-dir"`
|
Dir string `json:"data-dir"`
|
||||||
MaxSnapFiles uint `json:"max-snapshots"`
|
MaxSnapFiles uint `json:"max-snapshots"`
|
||||||
MaxWalFiles uint `json:"max-wals"`
|
MaxWALFiles uint `json:"max-wals"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
SnapshotCount uint64 `json:"snapshot-count"`
|
SnapshotCount uint64 `json:"snapshot-count"`
|
||||||
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`
|
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`
|
||||||
|
Loading…
Reference in New Issue
Block a user