You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: csvlog.go
    path of file: ./repos/hmq/plugins/bridge
    
    the code of the file until where you have to start completion: package bridge

/*
Copyright (c) 2021, Gary Barnett @thinkovation. Released under the Apache 2 License

CSVLog is a bridge plugin for HMQ that implements CSV logging of messages. See CSVLog.md for more information

*/

import (
	"encoding/csv"
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"sort"
	"strings"
	"sync"
	"time"

	"go.uber.org/zap"
)

type csvBridgeConfig struct {
	FileName          string   `json:"fileName"`
	LogFileMaxSizeMB  int64    `json:"logFileMaxSizeMB"`
	LogFileMaxFiles   int64    `json:"logFileMaxFiles"`
	WriteIntervalSecs int64    `json:"writeIntervalSecs"`
	CommandTopic      string   `json:"commandTopic"`
	Filters           []string `json:"filters"`
}

type csvLog struct {
	config  csvBridgeConfig
	buffer  []string
	msgchan chan 
    
func LoadCSVLogConfig() csvBridgeConfig {
	// Check to see if the CSVLOGCONFFILE environment variable is set and if so
	// check that it does actually point to a file
	csvLogConfigFile := os.Getenv("CSVLOGCONFFILE")
	if csvLogConfigFile != "" {
		if _, err := os.Stat(csvLogConfigFile); os.IsNotExist(err) {
			csvLogConfigFile = ""
		}
	}
	// If csvLogConfigFile is blank look in the plugins directory,
	// then the current directory for the csvLogConfigFile. If it's still not found we use a default config
	// If the file does not exist, we use default parameters
	if csvLogConfigFile == "" {
		csvLogConfigFile = "./plugins/csvlog/csvlogconfig.json"
	}
	if _, err := os.Stat(csvLogConfigFile); os.IsNotExist(err) {

		if _, err := os.Stat("csvlogconfig.json"); os.IsNotExist(err) {
			csvLogConfigFile = ""
		} else {
			csvLogConfigFile = "csvlogconfig.json"
		}
	}

	var configUnmarshalErr error
	var config csvBridgeConfig
	if csvLogConfigFile != "" {
		log.Info("Trying to load config file from " + csvLogConfigFile)
		content, err := ioutil.ReadFile(csvLogConfigFile)
		if err != nil {
			log.Info("Read config file error: ", zap.Error(err))
		}
		configUnmarshalErr = json.Unmarshal(content, &config)
	}

	if configUnmarshalErr != nil || config.FileName == "" {
		log.Warn("Unable to load csvlog config file, so using default settings")
		config.FileName = "/var/log/csvlog.log"
		config.CommandTopic = "CSVLOG/command"
		config.WriteIntervalSecs = 10
		config.LogFileMaxSizeMB = 1
		config.LogFileMaxFiles = 4

	}
	return config

}