rainbond: github.com/goodrain/rainbond/eventlog/db Index | Files

package db

import "github.com/goodrain/rainbond/eventlog/db"


Package Files

UnifyDB.go eventFilePlugin.go filePlugin.go manager.go model.go

func CheckLevel Uses

func CheckLevel(flag, level string) bool

CheckLevel check log level

func CreateDBManager Uses

func CreateDBManager(conf conf.DBConf) error

func GetLevelFlag Uses

func GetLevelFlag(level string) []byte

GetLevelFlag get log level flag

func GetServiceAliasID Uses

func GetServiceAliasID(ServiceID string) string

python: new_word = str(ord(string[10])) + string + str(ord(string[3])) + 'log' + str(ord(string[2]) / 7) new_id = hashlib.sha224(new_word).hexdigest()[0:16]

func GetTimeUnix Uses

func GetTimeUnix(timeStr string) int64

GetTimeUnix get specified time unix

func MvLogFile Uses

func MvLogFile(newName string, filePath string) error

MvLogFile 更改文件名称,压缩

type ClusterMessage Uses

type ClusterMessage struct {
    Data []byte
    Mode ClusterMessageType

type ClusterMessageType Uses

type ClusterMessageType string
const (
    //EventMessage 操作日志共享
    EventMessage ClusterMessageType = "event_log"
    //ServiceMonitorMessage 业务监控数据消息
    ServiceMonitorMessage ClusterMessageType = "monitor_message"
    //ServiceNewMonitorMessage 新业务监控数据消息
    ServiceNewMonitorMessage ClusterMessageType = "new_monitor_message"
    //MonitorMessage 节点监控数据
    MonitorMessage ClusterMessageType = "monitor"

type EventFilePlugin Uses

type EventFilePlugin struct {
    HomePath string

EventFilePlugin EventFilePlugin

func (*EventFilePlugin) Close Uses

func (m *EventFilePlugin) Close() error

Close Close

func (*EventFilePlugin) GetMessages Uses

func (m *EventFilePlugin) GetMessages(eventID, level string) (MessageDataList, error)

GetMessages GetMessages

func (*EventFilePlugin) SaveMessage Uses

func (m *EventFilePlugin) SaveMessage(events []*EventLogMessage) error

SaveMessage save event log to file

type EventLogMessage Uses

type EventLogMessage struct {
    EventID string `json:"event_id"`
    Step    string `json:"step"`
    Status  string `json:"status"`
    Message string `json:"message"`
    Level   string `json:"level"`
    Time    string `json:"time"`
    Content []byte `json:"-"`
    MonitorData []byte `json:"monitorData,omitempty"`

EventLogMessage 事件日志实体

type Manager Uses

type Manager interface {
    SaveMessage([]*EventLogMessage) error
    Close() error

func NewManager Uses

func NewManager(conf conf.DBConf, log *logrus.Entry) (Manager, error)

NewManager 创建存储管理器

type MessageData Uses

type MessageData struct {
    Message  string `json:"message"`
    Time     string `json:"time"`
    Unixtime int64  `json:"utime"`

MessageData message data 获取指定操作的操作日志

type MessageDataList Uses

type MessageDataList []MessageData

MessageDataList MessageDataList

func (MessageDataList) Len Uses

func (a MessageDataList) Len() int

func (MessageDataList) Less Uses

func (a MessageDataList) Less(i, j int) bool

func (MessageDataList) Swap Uses

func (a MessageDataList) Swap(i, j int)

type MonitorData Uses

type MonitorData struct {
    InstanceID   string
    ServiceSize  int
    LogSizePeerM int64

Package db imports 17 packages (graph) and is imported by 8 packages. Updated 2019-04-04. Refresh now. Tools for package owners.