db

package
v3.4.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2018 License: LGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDBManager

func CreateDBManager(conf conf.DBConf) error

func GetServiceAliasID

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 GzipEncode

func GzipEncode(in []byte) ([]byte, error)

func MvLogFile

func MvLogFile(newName string, filePath string) error

MvLogFile 更改文件名称,压缩

Types

type ClusterMessage

type ClusterMessage struct {
	Data []byte
	Mode ClusterMessageType
}

type ClusterMessageType

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

type EventLogMessage

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:"-"`
	//monitor消息使用
	MonitorData []byte `json:"monitorData,omitempty"`
}

EventLogMessage 事件日志实体

type Manager

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

func NewManager

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

NewManager 创建存储管理器

type MonitorData

type MonitorData struct {
	InstanceID   string
	ServiceSize  int
	LogSizePeerM int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL