Skip to content

Commit

Permalink
golint changes.
Browse files Browse the repository at this point in the history
This is mostly commentary adjustments via
https://travis-ci.org/cloudflare/cfssl/jobs/87769654.
  • Loading branch information
kisom committed Oct 27, 2015
1 parent 65c12ae commit 1209e80
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion transport/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ func (tr *Transport) TLSServerConfig() (*tls.Config, error) {
}, nil
}

// NewTransport builds a new transport from the default
// New builds a new transport from an identity and a before time. The
// before time tells the transport how long before the certificate
// expires to start attempting to update when auto-updating.
func New(before time.Duration, identity *core.Identity) (*Transport, error) {
var tr = &Transport{
Before: before,
Expand Down
3 changes: 2 additions & 1 deletion transport/core/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ type Identity struct {
Profiles map[string]map[string]string `json:"profiles"`
}

// A sensible default is to regenerate certificates the day before they expire.
// DefaultBefore is a sensible default; attempt to regenerate certificates the
// day before they expire.
var DefaultBefore = 24 * time.Hour

// CipherSuites are the TLS cipher suites that should be used by CloudFlare programs.
Expand Down
3 changes: 3 additions & 0 deletions transport/example/exlib/exlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

var progname = filepath.Base(os.Args[0])

// Before set to 5 minutes; certificates will attempt to auto-update 5
// minutes before they expire.
var Before = 5 * time.Minute

// Err displays a formatting error message to standard error,
Expand Down
3 changes: 3 additions & 0 deletions transport/roots/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/cloudflare/cfssl/transport/roots/system"
)

// Providers is a mapping of supported providers and the functions
// that can build them.
var Providers = map[string]func(map[string]string) ([]*x509.Certificate, error){
"system": system.New,
"cfssl": NewCFSSL,
Expand Down Expand Up @@ -52,6 +54,7 @@ func (ts *TrustStore) addCerts(certs []*x509.Certificate) {
}
}

// Trusted contains a store of trusted certificates.
type Trusted interface {
// Certificates returns a slice containing the certificates
// that are loaded into the provider.
Expand Down
4 changes: 2 additions & 2 deletions transport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestTransportSetup(t *testing.T) {
var before = 55 * time.Second
var err error

tr, err = NewTransport(before, testIdentity)
tr, err = New(before, testIdentity)
if err != nil {
t.Fatalf("failed to set up transport: %v", err)
}
Expand Down Expand Up @@ -225,7 +225,7 @@ func testListen(t *testing.T) {
func TestListener(t *testing.T) {
var before = 55 * time.Second

trl, err := NewTransport(before, testLIdentity)
trl, err := New(before, testLIdentity)
if err != nil {
t.Fatalf("failed to set up transport: %v", err)
}
Expand Down

0 comments on commit 1209e80

Please sign in to comment.