Skip to content

Commit ae9e416

Browse files
committed
Visibility tweak
1 parent 138b9a4 commit ae9e416

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

Diff for: log-courier.go

+13-14
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ import _ "github.com/driskell/log-courier/lc-lib/codecs"
4343
import _ "github.com/driskell/log-courier/lc-lib/transports/tcp"
4444

4545
func main() {
46-
logcourier := NewLogCourier()
47-
logcourier.Run()
46+
newLogCourier().Run()
4847
}
4948

50-
// LogCourier is the root structure for the log-courier binary
51-
type LogCourier struct {
49+
// logCourier is the root structure for the log-courier binary
50+
type logCourier struct {
5251
pipeline *core.Pipeline
5352
config *config.Config
5453
shutdownChan chan os.Signal
@@ -62,16 +61,16 @@ type LogCourier struct {
6261
snapshot *core.Snapshot
6362
}
6463

65-
// NewLogCourier creates a new LogCourier structure for the log-courier binary
66-
func NewLogCourier() *LogCourier {
67-
ret := &LogCourier{
64+
// newLogCourier creates a new LogCourier structure for the log-courier binary
65+
func newLogCourier() *logCourier {
66+
ret := &logCourier{
6867
pipeline: core.NewPipeline(),
6968
}
7069
return ret
7170
}
7271

7372
// Run starts the log-courier binary
74-
func (lc *LogCourier) Run() {
73+
func (lc *logCourier) Run() {
7574
var harvesterWait <-chan *harvester.FinishStatus
7675
var registrarImp registrar.Registrator
7776

@@ -154,7 +153,7 @@ SignalLoop:
154153
}
155154

156155
// startUp processes the command line arguments and sets up logging
157-
func (lc *LogCourier) startUp() {
156+
func (lc *logCourier) startUp() {
158157
var version bool
159158
var configTest bool
160159
var listSupported bool
@@ -234,7 +233,7 @@ func (lc *LogCourier) startUp() {
234233
}
235234

236235
// configureLogging enables the available logging backends
237-
func (lc *LogCourier) configureLogging() (err error) {
236+
func (lc *logCourier) configureLogging() (err error) {
238237
backends := make([]logging.Backend, 0, 1)
239238

240239
// First, the stdout backend
@@ -266,7 +265,7 @@ func (lc *LogCourier) configureLogging() (err error) {
266265
}
267266

268267
// loadConfig loads the configuration data
269-
func (lc *LogCourier) loadConfig() error {
268+
func (lc *logCourier) loadConfig() error {
270269
lc.config = config.NewConfig()
271270
if err := lc.config.Load(lc.configFile, true); err != nil {
272271
return err
@@ -284,7 +283,7 @@ func (lc *LogCourier) loadConfig() error {
284283
// reloadConfig reloads the configuration data and submits to all running
285284
// routines in the pipeline that are subscribed to it, so they may update their
286285
// runtime configuration
287-
func (lc *LogCourier) reloadConfig() error {
286+
func (lc *logCourier) reloadConfig() error {
288287
if err := lc.loadConfig(); err != nil {
289288
return err
290289
}
@@ -309,7 +308,7 @@ func (lc *LogCourier) reloadConfig() error {
309308
// processCommand is called from the admin routine in response to commands from
310309
// a connected lc-admin compatible utility
311310
// TODO: Replace with a REST API
312-
func (lc *LogCourier) processCommand(command string) *admin.Response {
311+
func (lc *logCourier) processCommand(command string) *admin.Response {
313312
switch command {
314313
case "RELD":
315314
if err := lc.reloadConfig(); err != nil {
@@ -329,7 +328,7 @@ func (lc *LogCourier) processCommand(command string) *admin.Response {
329328
}
330329

331330
// cleanShutdown initiates a clean shutdown of log-courier
332-
func (lc *LogCourier) cleanShutdown() {
331+
func (lc *logCourier) cleanShutdown() {
333332
log.Notice("Initiating shutdown")
334333

335334
if lc.harvester != nil {

Diff for: log-courier_nonwindows.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
// registerSignals registers platform specific shutdown signals with the shutdown
3232
// channel and reload signals with the reload channel
33-
func (lc *LogCourier) registerSignals() {
33+
func (lc *logCourier) registerSignals() {
3434
// *nix systems support SIGTERM so handle shutdown on that too
3535
signal.Notify(lc.shutdownChan, os.Interrupt, syscall.SIGTERM)
3636

@@ -40,7 +40,7 @@ func (lc *LogCourier) registerSignals() {
4040

4141
// configureLoggingPlatform enables platform specific logging backends in the
4242
// logging configuration
43-
func (lc *LogCourier) configureLoggingPlatform(backends *[]logging.Backend) error {
43+
func (lc *logCourier) configureLoggingPlatform(backends *[]logging.Backend) error {
4444
// Make it color if it's a TTY
4545
// TODO: This could be prone to problems when updating logging in future
4646
if lc.isatty(os.Stdout) && lc.config.General.LogStdout {
@@ -61,7 +61,7 @@ func (lc *LogCourier) configureLoggingPlatform(backends *[]logging.Backend) erro
6161

6262
// isatty is used to detect a console terminal so that coloured logging can be
6363
// enabled
64-
func (lc *LogCourier) isatty(f *os.File) bool {
64+
func (lc *logCourier) isatty(f *os.File) bool {
6565
var pgrp int64
6666
// NOTE(Driskell): Most real isatty implementations use TIOCGETA
6767
// However, TIOCGPRGP is easier than TIOCGETA as it only requires an int and not a termios struct

Diff for: log-courier_windows.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
// registerSignals registers platform specific shutdown signals with the shutdown
2929
// channel and reload signals with the reload channel
30-
func (lc *LogCourier) registerSignals() {
30+
func (lc *logCourier) registerSignals() {
3131
// Windows only supports os.Interrupt
3232
signal.Notify(lc.shutdownChan, os.Interrupt)
3333

@@ -36,6 +36,6 @@ func (lc *LogCourier) registerSignals() {
3636

3737
// configureLoggingPlatform enables platform specific logging backends in the
3838
// logging configuration
39-
func (lc *LogCourier) configureLoggingPlatform(backends *[]logging.Backend) error {
39+
func (lc *logCourier) configureLoggingPlatform(backends *[]logging.Backend) error {
4040
return nil
4141
}

0 commit comments

Comments
 (0)