report

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostName

func GetHostName(hostName string) string

GetHostName ...

func GetIP

func GetIP() string

GetIP ...

func ReturnAppIp added in v0.1.0

func ReturnAppIp() string

func ReturnHostName

func ReturnHostName() string

Types

type Config

type Config struct {
	Enable     bool          `json:"enable"`
	Debug      bool          `json:"debug"`
	Addr       string        `json:"addr"`
	Internal   time.Duration `json:"internal"`
	HostName   string        `json:"host_name"`
	RegionCode string        `json:"region_code"`
	RegionName string        `json:"region_name"`
	ZoneCode   string        `json:"zone_code"`
	ZoneName   string        `json:"zone_name"`
	Env        string        `json:"env"`
}

Config report config

func DefaultConfig

func DefaultConfig() Config

DefaultConfig return default config

func StdConfig

func StdConfig(key string) *Config

StdConfig returns standard configuration information

func (*Config) Build

func (r *Config) Build() *Report

Build new a instance

type ErrCode

type ErrCode int

ErrCode code

const (
	// ReportErr err code
	ReportErr ErrCode = 1
)

type HTTPReport

type HTTPReport struct {
	Config *Config
	// contains filtered or unexported fields
}

HTTPReport httpReport struct

func NewHTTPReport

func NewHTTPReport(config *Config) *HTTPReport

NewHTTPReport new httpReport

func (*HTTPReport) Report

func (r *HTTPReport) Report(info interface{}) ReporterResp

Report ...

type Report

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

Report ...

func (*Report) ReportAgentStatus

func (r *Report) ReportAgentStatus() error

ReportAgentStatus report agent status

type Reporter

type Reporter interface {
	Report(interface{}) ReporterResp
}

Reporter interface

type ReporterResp

type ReporterResp struct {
	Err  int
	Msg  string
	Data interface{}
}

ReporterResp ...

Jump to

Keyboard shortcuts

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