diff --git a/command/base/command.go b/command/base/command.go index 0feee18cc7..9e3ecc85e1 100644 --- a/command/base/command.go +++ b/command/base/command.go @@ -36,10 +36,10 @@ type Command struct { hidden *flag.FlagSet // These are the options which correspond to the HTTP API options - httpAddr stringValue - token stringValue - datacenter stringValue - stale boolValue + httpAddr StringValue + token StringValue + datacenter StringValue + stale BoolValue } // HTTPClient returns a client with the parsed flags. It panics if the command diff --git a/command/base/config_util.go b/command/base/config_util.go index 7eac69cd27..b29c3fa2e7 100644 --- a/command/base/config_util.go +++ b/command/base/config_util.go @@ -20,32 +20,32 @@ import ( // configDecodeHook should be passed to mapstructure in order to decode into // the *Value objects here. -var configDecodeHook = mapstructure.ComposeDecodeHookFunc( - boolToBoolValueFunc(), - stringToDurationValueFunc(), - stringToStringValueFunc(), - float64ToUintValueFunc(), +var ConfigDecodeHook = mapstructure.ComposeDecodeHookFunc( + BoolToBoolValueFunc(), + StringToDurationValueFunc(), + StringToStringValueFunc(), + Float64ToUintValueFunc(), ) -// boolValue provides a flag value that's aware if it has been set. -type boolValue struct { +// BoolValue provides a flag value that's aware if it has been set. +type BoolValue struct { v *bool } // See flag.Value. -func (b *boolValue) IsBoolFlag() bool { +func (b *BoolValue) IsBoolFlag() bool { return true } // Merge will overlay this value if it has been set. -func (b *boolValue) Merge(onto *bool) { +func (b *BoolValue) Merge(onto *bool) { if b.v != nil { *onto = *(b.v) } } // See flag.Value. -func (b *boolValue) Set(v string) error { +func (b *BoolValue) Set(v string) error { if b.v == nil { b.v = new(bool) } @@ -55,7 +55,7 @@ func (b *boolValue) Set(v string) error { } // See flag.Value. -func (b *boolValue) String() string { +func (b *BoolValue) String() string { var current bool if b.v != nil { current = *(b.v) @@ -63,9 +63,9 @@ func (b *boolValue) String() string { return fmt.Sprintf("%v", current) } -// boolToBoolValueFunc is a mapstructure hook that looks for an incoming bool -// mapped to a boolValue and does the translation. -func boolToBoolValueFunc() mapstructure.DecodeHookFunc { +// BoolToBoolValueFunc is a mapstructure hook that looks for an incoming bool +// mapped to a BoolValue and does the translation. +func BoolToBoolValueFunc() mapstructure.DecodeHookFunc { return func( f reflect.Type, t reflect.Type, @@ -74,7 +74,7 @@ func boolToBoolValueFunc() mapstructure.DecodeHookFunc { return data, nil } - val := boolValue{} + val := BoolValue{} if t != reflect.TypeOf(val) { return data, nil } @@ -85,20 +85,20 @@ func boolToBoolValueFunc() mapstructure.DecodeHookFunc { } } -// durationValue provides a flag value that's aware if it has been set. -type durationValue struct { +// DurationValue provides a flag value that's aware if it has been set. +type DurationValue struct { v *time.Duration } // Merge will overlay this value if it has been set. -func (d *durationValue) Merge(onto *time.Duration) { +func (d *DurationValue) Merge(onto *time.Duration) { if d.v != nil { *onto = *(d.v) } } // See flag.Value. -func (d *durationValue) Set(v string) error { +func (d *DurationValue) Set(v string) error { if d.v == nil { d.v = new(time.Duration) } @@ -108,7 +108,7 @@ func (d *durationValue) Set(v string) error { } // See flag.Value. -func (d *durationValue) String() string { +func (d *DurationValue) String() string { var current time.Duration if d.v != nil { current = *(d.v) @@ -116,9 +116,9 @@ func (d *durationValue) String() string { return current.String() } -// stringToDurationValueFunc is a mapstructure hook that looks for an incoming -// string mapped to a durationValue and does the translation. -func stringToDurationValueFunc() mapstructure.DecodeHookFunc { +// StringToDurationValueFunc is a mapstructure hook that looks for an incoming +// string mapped to a DurationValue and does the translation. +func StringToDurationValueFunc() mapstructure.DecodeHookFunc { return func( f reflect.Type, t reflect.Type, @@ -127,7 +127,7 @@ func stringToDurationValueFunc() mapstructure.DecodeHookFunc { return data, nil } - val := durationValue{} + val := DurationValue{} if t != reflect.TypeOf(val) { return data, nil } @@ -138,20 +138,20 @@ func stringToDurationValueFunc() mapstructure.DecodeHookFunc { } } -// stringValue provides a flag value that's aware if it has been set. -type stringValue struct { +// StringValue provides a flag value that's aware if it has been set. +type StringValue struct { v *string } // Merge will overlay this value if it has been set. -func (s *stringValue) Merge(onto *string) { +func (s *StringValue) Merge(onto *string) { if s.v != nil { *onto = *(s.v) } } // See flag.Value. -func (s *stringValue) Set(v string) error { +func (s *StringValue) Set(v string) error { if s.v == nil { s.v = new(string) } @@ -160,7 +160,7 @@ func (s *stringValue) Set(v string) error { } // See flag.Value. -func (s *stringValue) String() string { +func (s *StringValue) String() string { var current string if s.v != nil { current = *(s.v) @@ -168,9 +168,9 @@ func (s *stringValue) String() string { return current } -// stringToStringValueFunc is a mapstructure hook that looks for an incoming -// string mapped to a stringValue and does the translation. -func stringToStringValueFunc() mapstructure.DecodeHookFunc { +// StringToStringValueFunc is a mapstructure hook that looks for an incoming +// string mapped to a StringValue and does the translation. +func StringToStringValueFunc() mapstructure.DecodeHookFunc { return func( f reflect.Type, t reflect.Type, @@ -179,7 +179,7 @@ func stringToStringValueFunc() mapstructure.DecodeHookFunc { return data, nil } - val := stringValue{} + val := StringValue{} if t != reflect.TypeOf(val) { return data, nil } @@ -189,20 +189,20 @@ func stringToStringValueFunc() mapstructure.DecodeHookFunc { } } -// uintValue provides a flag value that's aware if it has been set. -type uintValue struct { +// UintValue provides a flag value that's aware if it has been set. +type UintValue struct { v *uint } // Merge will overlay this value if it has been set. -func (u *uintValue) Merge(onto *uint) { +func (u *UintValue) Merge(onto *uint) { if u.v != nil { *onto = *(u.v) } } // See flag.Value. -func (u *uintValue) Set(v string) error { +func (u *UintValue) Set(v string) error { if u.v == nil { u.v = new(uint) } @@ -212,7 +212,7 @@ func (u *uintValue) Set(v string) error { } // See flag.Value. -func (u *uintValue) String() string { +func (u *UintValue) String() string { var current uint if u.v != nil { current = *(u.v) @@ -220,9 +220,9 @@ func (u *uintValue) String() string { return fmt.Sprintf("%v", current) } -// float64ToUintValueFunc is a mapstructure hook that looks for an incoming -// float64 mapped to a uintValue and does the translation. -func float64ToUintValueFunc() mapstructure.DecodeHookFunc { +// Float64ToUintValueFunc is a mapstructure hook that looks for an incoming +// float64 mapped to a UintValue and does the translation. +func Float64ToUintValueFunc() mapstructure.DecodeHookFunc { return func( f reflect.Type, t reflect.Type, @@ -231,7 +231,7 @@ func float64ToUintValueFunc() mapstructure.DecodeHookFunc { return data, nil } - val := uintValue{} + val := UintValue{} if t != reflect.TypeOf(val) { return data, nil } @@ -254,14 +254,14 @@ func float64ToUintValueFunc() mapstructure.DecodeHookFunc { } } -// visitFn is a callback that gets a chance to visit each file found during a +// VisitFn is a callback that gets a chance to visit each file found during a // traversal with visit(). -type visitFn func(path string) error +type VisitFn func(path string) error // visit will call the visitor function on the path if it's a file, or for each // file in the path if it's a directory. Directories will not be recursed into, // and files in the directory will be visited in alphabetical order. -func visit(path string, visitor visitFn) error { +func Visit(path string, visitor VisitFn) error { f, err := os.Open(path) if err != nil { return fmt.Errorf("error reading %q: %v", path, err) diff --git a/command/base/config_util_test.go b/command/base/config_util_test.go index b8264751fb..0fc3ae6a71 100644 --- a/command/base/config_util_test.go +++ b/command/base/config_util_test.go @@ -14,10 +14,10 @@ import ( func TestConfigUtil_Values(t *testing.T) { type config struct { - B boolValue `mapstructure:"bool"` - D durationValue `mapstructure:"duration"` - S stringValue `mapstructure:"string"` - U uintValue `mapstructure:"uint"` + B BoolValue `mapstructure:"bool"` + D DurationValue `mapstructure:"duration"` + S StringValue `mapstructure:"string"` + U UintValue `mapstructure:"uint"` } cases := []struct { @@ -70,7 +70,7 @@ func TestConfigUtil_Values(t *testing.T) { var r config msdec, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - DecodeHook: configDecodeHook, + DecodeHook: ConfigDecodeHook, Result: &r, ErrorUnused: true, }) @@ -108,10 +108,10 @@ func TestConfigUtil_Visit(t *testing.T) { } basePath := "../../test/command/merge" - if err := visit(basePath, visitor); err != nil { + if err := Visit(basePath, visitor); err != nil { t.Fatalf("err: %v", err) } - if err := visit(path.Join(basePath, "subdir", "c.json"), visitor); err != nil { + if err := Visit(path.Join(basePath, "subdir", "c.json"), visitor); err != nil { t.Fatalf("err: %v", err) } diff --git a/consul/rpc.go b/consul/rpc.go index 43ff3b4a48..ef11c376b4 100644 --- a/consul/rpc.go +++ b/consul/rpc.go @@ -29,6 +29,7 @@ const ( rpcTLS rpcMultiplexV2 rpcSnapshot + rpcGossip ) const ( diff --git a/website/source/assets/images/logo-header.png b/website/source/assets/images/logo-header.png deleted file mode 100644 index d7e863ce2f..0000000000 Binary files a/website/source/assets/images/logo-header.png and /dev/null differ diff --git a/website/source/assets/images/logo-header.svg b/website/source/assets/images/logo-header.svg new file mode 100644 index 0000000000..7ee9d85ca4 --- /dev/null +++ b/website/source/assets/images/logo-header.svg @@ -0,0 +1,39 @@ + + + HashiCorp Consul + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/logo-header@2x.png b/website/source/assets/images/logo-header@2x.png deleted file mode 100644 index 56b47c904d..0000000000 Binary files a/website/source/assets/images/logo-header@2x.png and /dev/null differ diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 98a67644d1..10f8f13171 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -8,6 +8,11 @@ body.layout-intro{ #main-content{ min-height: 600px; + + h1, h2, h3, h4, h5 { + font-family: $font-family-open-sans; + text-transform: none; + } } >.container{ @@ -103,34 +108,33 @@ body.layout-intro{ /*> a:hover, > a:focus { - font-weight: $font-weight-museo-xb; + font-weight: font-weight-xb; }*/ .nav { display: block; li.active a { - font-weight: $font-weight-museo-xb; + font-weight: font-weight-xb; } li.active .subnav { display: block; li a { - font-weight: $font-weight-museo-sb; + font-weight: $font-weight-sb; } li.active a { - font-weight: $font-weight-museo-xb; + font-weight: font-weight-xb; } } } } > a { - text-transform: uppercase; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-family: $font-family-open-sans; + font-weight: 600; -webkit-font-smoothing: antialiased; } } @@ -143,9 +147,9 @@ body.layout-intro{ margin-left: 20px; > a{ - -webkit-font-smoothing: antialiased; - font-family: $font-family-source-sans; padding: 6px 15px; + font-weight: 500; + -webkit-font-smoothing: antialiased; } .subnav { @@ -156,7 +160,6 @@ body.layout-intro{ padding: 6px 0; > a{ -webkit-font-smoothing: antialiased; - font-family: $font-family-source-sans; } } } @@ -188,9 +191,8 @@ body.layout-intro{ } p, li, .alert { - font-size: 20px; - font-family: $font-family-source-sans; - font-weight: $font-weight-open; + font-size: 18px; + font-weight: 400; line-height: 1.5em; margin: 0 0 18px; -webkit-font-smoothing: antialiased; @@ -234,6 +236,7 @@ body.layout-intro{ } h2, h3, h4{ + margin-top: 42px; margin-bottom: 16px; } diff --git a/website/source/assets/stylesheets/_fonts.scss b/website/source/assets/stylesheets/_fonts.scss deleted file mode 100755 index 622dc908da..0000000000 --- a/website/source/assets/stylesheets/_fonts.scss +++ /dev/null @@ -1,21 +0,0 @@ -// -// Typography -// -------------------------------------------------- - -//light -.rls-l{ - font-family: $font-family-museo; - font-weight: $font-weight-museo-xl; -} - -//semibold -.rls-sb{ - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; -} - -//extrabold -.rls-xb{ - font-family: $font-family-museo; - font-weight: $font-weight-museo-xb; -} diff --git a/website/source/assets/stylesheets/_global.scss b/website/source/assets/stylesheets/_global.scss index bb34b2df39..46319707b3 100755 --- a/website/source/assets/stylesheets/_global.scss +++ b/website/source/assets/stylesheets/_global.scss @@ -13,19 +13,26 @@ body { font-weight: 300; } +h1, h2, h3, h4, h5 { + font-family: $font-family-klavika; + text-transform: uppercase; +} + h1{ font-size: 42px; line-height: 42px; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-weight: $font-weight-sb; margin-bottom: 24px; } h3{ font-size: 28px; line-height: 28px; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-weight: $font-weight-sb; +} + +p, a, input, .alert { + font-family: $font-family-open-sans; } //an alternative color for buttons in the doc body diff --git a/website/source/assets/stylesheets/_header.scss b/website/source/assets/stylesheets/_header.scss index 1f2088e622..917acbd312 100755 --- a/website/source/assets/stylesheets/_header.scss +++ b/website/source/assets/stylesheets/_header.scss @@ -27,8 +27,8 @@ body.page-sub{ background-position: 0 center; font-size: 0; text-transform: uppercase; - @include img-retina("../images/consul-header-lockup.png", "../images/consul-header-lockup@2x.png", $project-logo-width, $project-logo-height); - background-position: 0 center; + background: url("../images/logo-header.svg") center no-repeat; + background-size: 100%; &:hover{ opacity: .4; @@ -56,18 +56,9 @@ body.page-sub{ .navbar-brand { .logo{ width: $project-logo-width * .75; - @include img-retina("../images/consul-header-lockup.png", "../images/consul-header-lockup@2x.png", $project-logo-width * .75, $project-logo-height * .75); - } - } - } -} - - -@media (max-width: 320px) { - #header { - .navbar-brand { - .logo{ - + } + .by-hashicorp{ + margin-top: 2px; } } } diff --git a/website/source/assets/stylesheets/_home.scss b/website/source/assets/stylesheets/_home.scss index 3dd9d26475..a8e72d972f 100755 --- a/website/source/assets/stylesheets/_home.scss +++ b/website/source/assets/stylesheets/_home.scss @@ -19,18 +19,17 @@ body.page-home{ h2{ font-size: 24px; - letter-spacing: 2px; + letter-spacing: 1px; color: $purple; - font-family: $font-family-museo; - font-weight: $font-weight-museo-xb; + font-family: $font-family-klavika; + font-weight: font-weight-xb; } p{ font-size: 16px; - letter-spacing: 1px; line-height: 1.5em; color: $consul-gray; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-family: $font-family-open-sans; + font-weight: $font-weight-sb; } .icn{ @@ -108,30 +107,26 @@ body.page-home{ } p{ - font-size: 14px; - letter-spacing: 1px; + font-size: 18px; line-height: 1.5em; color: $consul-gray; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-weight: $font-weight-sb; } - - .outline-btn { padding: 8px; display: inline-block; + &:focus { outline: 0; } - } a { font-weight: 500; font-size: 16px; text-transform: uppercase; - letter-spacing: 3px; + letter-spacing: 1px; color: $purple; &:hover { text-decoration: none; @@ -150,17 +145,16 @@ body.page-home{ h2 { font-size: 22px; text-transform: uppercase; - font-family: $font-family-museo; - font-weight: $font-weight-museo-xb; + font-family: $font-family-klavika; + font-weight: font-weight-xb; } p{ font-size: 16px; - letter-spacing: 1px; line-height: 1.5em; color: $consul-gray; - font-family: $font-family-museo; - font-weight: $font-weight-museo-sb; + font-family: $font-family-open-sans; + font-weight: $font-weight-sb; } } @@ -213,8 +207,8 @@ body.page-home{ font-size: 14px; letter-spacing: 1px; color: $gray-darker; - font-family: $font-family-museo; - font-weight: $font-weight-museo-xb; + font-family: $font-family-klavika; + font-weight: font-weight-xb; } ul.shell-dots{ @@ -239,7 +233,6 @@ body.page-home{ padding: 20px; font-size: 15px; font-weight: normal; - font-family: "Courier New", Monaco, Menlo, Consolas, monospace; color: $white; .txt-r { @@ -251,6 +244,7 @@ body.page-home{ } p{ margin-bottom: 2px; + font-family: $font-family-mono; white-space: pre-wrap; } .cursor { diff --git a/website/source/assets/stylesheets/_jumbotron.scss b/website/source/assets/stylesheets/_jumbotron.scss index c4059f6f3f..309746185c 100755 --- a/website/source/assets/stylesheets/_jumbotron.scss +++ b/website/source/assets/stylesheets/_jumbotron.scss @@ -43,6 +43,7 @@ position: relative; height: 100%; margin-top: $header-height; + padding-left: 0; -webkit-backface-visibility:hidden; .jumbo-logo-wrap{ @@ -58,18 +59,23 @@ } h2{ - margin-top: 175px; + margin-top: 220px; font-size: 40px; line-height: 48px; letter-spacing: 1px; - margin-left: 40px; + } + + .lead { + font-weight: $font-weight-sb; + letter-spacing: .5px; + opacity: .89; } } } @media (max-width: 992px) { #jumbotron .container { - h2{ + h2, p.lead{ text-align: center; margin-left: 0; } @@ -82,7 +88,7 @@ @media (max-width: 480px) { #jumbotron .container { h2{ - margin-top: 130px; + margin-top: 200px; font-size: 32px; } } diff --git a/website/source/assets/stylesheets/_variables.scss b/website/source/assets/stylesheets/_variables.scss index a6049b0eed..2fa9161a5e 100755 --- a/website/source/assets/stylesheets/_variables.scss +++ b/website/source/assets/stylesheets/_variables.scss @@ -46,13 +46,14 @@ $link-hover-color: darken($link-color, 15%); // Typography // ------------------------- -$font-family-museo: 'museo-sans', "Helvetica Neue", Helvetica, Arial, sans-serif; -$font-family-source-sans: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif; -$font-weight-museo-xl: 100; -$font-weight-museo-reg: 300; -$font-weight-museo-sb: 500; -$font-weight-museo-xb: 700; -$font-weight-open: $font-weight-museo-reg; +$font-family-open-sans: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +$font-family-klavika: "klavika-web", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +$font-family-mono: "Courier New", Monaco, Menlo, Consolas, monospace; +$font-weight-xl: 100; +$font-weight-reg: 300; +$font-weight-sb: 500; +$font-weight-xb: 700; +$font-weight-open: $font-weight-reg; $text-shadow: 1px 1px 1px #000; diff --git a/website/source/assets/stylesheets/application.scss b/website/source/assets/stylesheets/application.scss index f20d2ee0f4..a4ce07f3e6 100644 --- a/website/source/assets/stylesheets/application.scss +++ b/website/source/assets/stylesheets/application.scss @@ -11,9 +11,6 @@ // Utility classes @import "_utilities"; -// Core CSS -@import "_fonts"; - //Global Site @import "_global"; diff --git a/website/source/assets/stylesheets/hashicorp-shared/_project-utility.scss b/website/source/assets/stylesheets/hashicorp-shared/_project-utility.scss index b90d5a3293..a0608f2ada 100755 --- a/website/source/assets/stylesheets/hashicorp-shared/_project-utility.scss +++ b/website/source/assets/stylesheets/hashicorp-shared/_project-utility.scss @@ -4,8 +4,8 @@ // -------------------------------------------------- // Variables -$project-logo-width: 147px; -$project-logo-height: 40px; +$project-logo-width: 154px; +$project-logo-height: 48px; $project-logo-pad-left: 0px; $header-height: 80px; diff --git a/website/source/index.html.erb b/website/source/index.html.erb index 5bf9fb98d8..a12a18a484 100644 --- a/website/source/index.html.erb +++ b/website/source/index.html.erb @@ -12,9 +12,11 @@ description: |-

Service discovery and configuration made easy. +

+

Distributed, highly available, and datacenter-aware. - +