Documentation ¶
Index ¶
- Constants
- Variables
- func CheckKafkaConn()
- func CreateConnection()
- func CreateJsonHeader(logMsg []byte, containerName string) []byte
- func Exists(name string) bool
- func GetConnection() (net.Conn, error)
- func GetContainerName(filename string) (string, error)
- func GetFileSize(fileName string) int64
- func GetFiles() []os.FileInfo
- func GetLoggingEndpoint() (string, error)
- func GetLoggingListenPort(port string) string
- func GetLoggingSvc(svc string) string
- func HandleCIMTermination()
- func HandleNatsSubscriptions()
- func InitialiseTCPLoggingParams()
- func LogModeKafka(logMsg []byte, fileName string, s *NatsSubscriber)
- func LogModeSTDOUT(logmsg []byte, containerName string)
- func LogModeTCP(logMsg []byte, fileName string, s *NatsSubscriber)
- func NewLogger(fileName string, conf types.Lmaas) *lumberjack.Logger
- func Push(ctx context.Context, key, value []byte, k *KafkaPublisher, ...) (err error)
- func Readln(r *bufio.Reader) ([]byte, error)
- func RecreateLumberjackObj()
- func Retransmit(files []os.FileInfo)
- func UpdateConfigCommitDetails(commitDetails map[string]string, cId int, cmType ...string) (err error)
- func ValidatePort(port string) bool
- func ValidateSvcUrl(url string) bool
- func WatchConfigChange(etcd *clientv3.Client, etcdWatchKey, appPort string)
- func WatchDayOneConfig()
- func WatchFilesRotation()
- func WatchLogDirectory()
- type JsonLog
- type KafkaPublisher
- type Kubernetes
- type NatsSubscriber
- type SubscribeHandler
- type TickerSyncMap
Constants ¶
View Source
const DIR = "/opt/logs/"
Variables ¶
View Source
var ( KafkaPublisherEvent *KafkaPublisher AppConfigured bool InitialNotConfiguredEvent bool )
View Source
var ( KafkaLogConn *KafkaPublisher LogFormatJson bool )
View Source
var ( TCPcon *net.TCPConn LogConnExist bool EnableDaemonsetPush bool EnableTCPLogging bool Address string )
View Source
var (
DayOneConfig string
)
Functions ¶
func CreateConnection ¶
func CreateConnection()
func CreateJsonHeader ¶
func GetConnection ¶
func GetContainerName ¶
func GetFileSize ¶
func GetLoggingEndpoint ¶
func GetLoggingListenPort ¶
func GetLoggingSvc ¶
func HandleNatsSubscriptions ¶
func HandleNatsSubscriptions()
HandleNatsSubscriptions handles the topic subscribed to nats
func InitialiseTCPLoggingParams ¶
func InitialiseTCPLoggingParams()
func LogModeKafka ¶
func LogModeKafka(logMsg []byte, fileName string, s *NatsSubscriber)
func LogModeSTDOUT ¶
func LogModeTCP ¶
func LogModeTCP(logMsg []byte, fileName string, s *NatsSubscriber)
func Push ¶
func Push(ctx context.Context, key, value []byte, k *KafkaPublisher, header []kafka.Header) (err error)
Push messages to kafka
func RecreateLumberjackObj ¶
func RecreateLumberjackObj()
func Retransmit ¶
func ValidatePort ¶
func ValidateSvcUrl ¶
func WatchConfigChange ¶
WatchConfigChange for configuration
func WatchFilesRotation ¶
func WatchFilesRotation()
Types ¶
type JsonLog ¶
type JsonLog struct { Containername string `json:"container_name"` Log string `json:"log"` K8s Kubernetes `json:"kubernetes"` }
type KafkaPublisher ¶
type KafkaPublisher struct { Context context.Context Subject string Namespace string PodID string Writer *kafka.Writer }
KafkaPublisher struct
func IntialiseKafkaProducer ¶
func IntialiseKafkaProducer() (*KafkaPublisher, error)
Initialise kafka producer
func NewKafkaPublisher ¶
func NewKafkaPublisher(subject string, w *kafka.Writer) *KafkaPublisher
NewKafkaPublisher initialize
func (KafkaPublisher) HandleMessages ¶
func (k KafkaPublisher) HandleMessages(msg *nats.Msg)
HandleMessages handles messages in the NATS
type Kubernetes ¶
type NatsSubscriber ¶
type NatsSubscriber struct { Subject string QueueGroup string PodID string Namespace string FileConfig types.Lmaas FlushTimeout time.Duration // contains filtered or unexported fields }
func NewNatsSubscription ¶
func NewNatsSubscription(subject string) *NatsSubscriber
NewNatsSubscription return new nats subscription
func (*NatsSubscriber) FlushBufferedLogsToFile ¶
func (s *NatsSubscriber) FlushBufferedLogsToFile()
func (*NatsSubscriber) FlushDataBeforeExit ¶
func (s *NatsSubscriber) FlushDataBeforeExit()
FlushDataBeforeExit flush data
func (*NatsSubscriber) HandleMessages ¶
func (s *NatsSubscriber) HandleMessages(msg *nats.Msg)
HandleMessages handles the log messages
func (*NatsSubscriber) StartMonitoringFlushLog ¶
func (s *NatsSubscriber) StartMonitoringFlushLog(flushedfileName string)
StartMonitoringFlushLog start monitorting the flush data
type SubscribeHandler ¶
type SubscribeHandler interface { HandleMessages(msg *nats.Msg) Name() string }
SubscribeHandler struct
type TickerSyncMap ¶
type TickerSyncMap struct {
// contains filtered or unexported fields
}
func (*TickerSyncMap) Load ¶
func (m *TickerSyncMap) Load(key string) *fileTicker
func (*TickerSyncMap) Store ¶
func (m *TickerSyncMap) Store(key string, value *fileTicker)
Click to show internal directories.
Click to hide internal directories.