@@ -43,12 +43,11 @@ import _ "github.com/driskell/log-courier/lc-lib/codecs"
43
43
import _ "github.com/driskell/log-courier/lc-lib/transports/tcp"
44
44
45
45
func main () {
46
- logcourier := NewLogCourier ()
47
- logcourier .Run ()
46
+ newLogCourier ().Run ()
48
47
}
49
48
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 {
52
51
pipeline * core.Pipeline
53
52
config * config.Config
54
53
shutdownChan chan os.Signal
@@ -62,16 +61,16 @@ type LogCourier struct {
62
61
snapshot * core.Snapshot
63
62
}
64
63
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 {
68
67
pipeline : core .NewPipeline (),
69
68
}
70
69
return ret
71
70
}
72
71
73
72
// Run starts the log-courier binary
74
- func (lc * LogCourier ) Run () {
73
+ func (lc * logCourier ) Run () {
75
74
var harvesterWait <- chan * harvester.FinishStatus
76
75
var registrarImp registrar.Registrator
77
76
@@ -154,7 +153,7 @@ SignalLoop:
154
153
}
155
154
156
155
// startUp processes the command line arguments and sets up logging
157
- func (lc * LogCourier ) startUp () {
156
+ func (lc * logCourier ) startUp () {
158
157
var version bool
159
158
var configTest bool
160
159
var listSupported bool
@@ -234,7 +233,7 @@ func (lc *LogCourier) startUp() {
234
233
}
235
234
236
235
// configureLogging enables the available logging backends
237
- func (lc * LogCourier ) configureLogging () (err error ) {
236
+ func (lc * logCourier ) configureLogging () (err error ) {
238
237
backends := make ([]logging.Backend , 0 , 1 )
239
238
240
239
// First, the stdout backend
@@ -266,7 +265,7 @@ func (lc *LogCourier) configureLogging() (err error) {
266
265
}
267
266
268
267
// loadConfig loads the configuration data
269
- func (lc * LogCourier ) loadConfig () error {
268
+ func (lc * logCourier ) loadConfig () error {
270
269
lc .config = config .NewConfig ()
271
270
if err := lc .config .Load (lc .configFile , true ); err != nil {
272
271
return err
@@ -284,7 +283,7 @@ func (lc *LogCourier) loadConfig() error {
284
283
// reloadConfig reloads the configuration data and submits to all running
285
284
// routines in the pipeline that are subscribed to it, so they may update their
286
285
// runtime configuration
287
- func (lc * LogCourier ) reloadConfig () error {
286
+ func (lc * logCourier ) reloadConfig () error {
288
287
if err := lc .loadConfig (); err != nil {
289
288
return err
290
289
}
@@ -309,7 +308,7 @@ func (lc *LogCourier) reloadConfig() error {
309
308
// processCommand is called from the admin routine in response to commands from
310
309
// a connected lc-admin compatible utility
311
310
// TODO: Replace with a REST API
312
- func (lc * LogCourier ) processCommand (command string ) * admin.Response {
311
+ func (lc * logCourier ) processCommand (command string ) * admin.Response {
313
312
switch command {
314
313
case "RELD" :
315
314
if err := lc .reloadConfig (); err != nil {
@@ -329,7 +328,7 @@ func (lc *LogCourier) processCommand(command string) *admin.Response {
329
328
}
330
329
331
330
// cleanShutdown initiates a clean shutdown of log-courier
332
- func (lc * LogCourier ) cleanShutdown () {
331
+ func (lc * logCourier ) cleanShutdown () {
333
332
log .Notice ("Initiating shutdown" )
334
333
335
334
if lc .harvester != nil {
0 commit comments