Fix verification of boilerplate, style and file headers
This commit is contained in:
parent
738d83985e
commit
a4f67c0853
20 changed files with 297 additions and 18 deletions
|
|
@ -1,3 +1,19 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package file
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,19 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package file
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,19 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ NGINX master process died (%v): %v
|
|||
return true
|
||||
}
|
||||
|
||||
// WaitUntilPortIsAvailable waits until there is no NGINX master or worker
|
||||
// process/es listentning in a particular port.
|
||||
func WaitUntilPortIsAvailable(port int) {
|
||||
// we wait until the workers are killed
|
||||
for {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/paultag/sniff/parser"
|
||||
)
|
||||
|
||||
// TCPServer describes a server that works in passthrough mode
|
||||
type TCPServer struct {
|
||||
Hostname string
|
||||
IP string
|
||||
|
|
@ -33,11 +34,13 @@ type TCPServer struct {
|
|||
ProxyProtocol bool
|
||||
}
|
||||
|
||||
// TCPProxy describes the passthrough servers and a default as catch all
|
||||
type TCPProxy struct {
|
||||
ServerList []*TCPServer
|
||||
Default *TCPServer
|
||||
}
|
||||
|
||||
// Get returns the TCPServer to use
|
||||
func (p *TCPProxy) Get(host string) *TCPServer {
|
||||
if p.ServerList == nil {
|
||||
return p.Default
|
||||
|
|
@ -52,6 +55,8 @@ func (p *TCPProxy) Get(host string) *TCPServer {
|
|||
return p.Default
|
||||
}
|
||||
|
||||
// Handle reads enough information from the connection to extract the hostname
|
||||
// and open a connection to the passthrough server.
|
||||
func (p *TCPProxy) Handle(conn net.Conn) {
|
||||
defer conn.Close()
|
||||
data := make([]byte, 4096)
|
||||
|
|
|
|||
|
|
@ -84,10 +84,13 @@ func IsInvalidContent(e error) bool {
|
|||
return ok
|
||||
}
|
||||
|
||||
// New returns a new error
|
||||
func New(m string) error {
|
||||
return errors.New(m)
|
||||
}
|
||||
|
||||
// Errorf formats according to a format specifier and returns the string
|
||||
// as a value that satisfies error.
|
||||
func Errorf(format string, args ...interface{}) error {
|
||||
return errors.Errorf(format, args)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package watch
|
|||
// DummyFileWatcher noop implementation of a file watcher
|
||||
type DummyFileWatcher struct{}
|
||||
|
||||
// NewDummyFileWatcher creates a FileWatcher using the DummyFileWatcher
|
||||
func NewDummyFileWatcher(file string, onEvent func()) FileWatcher {
|
||||
return DummyFileWatcher{}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import (
|
|||
"gopkg.in/fsnotify.v1"
|
||||
)
|
||||
|
||||
// FileWatcher is an interface we use to watch changes in files
|
||||
type FileWatcher interface {
|
||||
Close() error
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue