reporter

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEvent

type CloudEvent struct {
	SpecVersion     string                 `json:"specversion"`
	Type            string                 `json:"type"`
	Source          string                 `json:"source"`
	ID              string                 `json:"id"`
	Time            string                 `json:"time"`
	DataContentType string                 `json:"datacontenttype"`
	Token           string                 `json:"token,omitempty"`
	Data            map[string]interface{} `json:"data"`
}

CloudEvent 遵循 CloudEvents 1.0 规范

type CoredumpUploadedData

type CoredumpUploadedData struct {
	FileURL        string `json:"file_url"`
	FileName       string `json:"file_name"`
	ExecutablePath string `json:"executable_path"`
	FileSize       int64  `json:"file_size"`
	MD5            string `json:"md5"`
	Image          string `json:"image"`
	Timestamp      string `json:"timestamp"`
	PodName        string `json:"pod_name"`
	PodNamespace   string `json:"pod_namespace"`
	NodeIP         string `json:"node_ip,omitempty"` // Pod 所在节点的 IP,从 status.hostIP 获取
}

CoredumpUploadedData 上传成功的 core dump 数据

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter 负责向 CoreSight 上报事件(通过 HTTP API)

func NewReporter

func NewReporter(apiURL string) *Reporter

NewReporter 创建新的 reporter(使用 HTTP API)

func NewReporterWithToken

func NewReporterWithToken(apiURL string, token string) *Reporter

NewReporterWithToken 创建新的 reporter(使用 HTTP API,并设置 token)

func (*Reporter) Close

func (r *Reporter) Close() error

Close 关闭 reporter 连接

func (*Reporter) ReportCoredumpUploaded

func (r *Reporter) ReportCoredumpUploaded(ctx context.Context, data *CoredumpUploadedData) error

ReportCoredumpUploaded 上报 coredump 上传事件到 CoreSight

Jump to

Keyboard shortcuts

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