model

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string `json:"username,omitempty" config:"username" elastic_mapping:"username:{type:keyword}"`
	//password should not be logged, neither in json nor in log
	Password ucfg.SecretString `json:"password,omitempty" config:"password" yaml:"password" elastic_mapping:"password:{type:keyword}"`
}

type ESNodeInfo

type ESNodeInfo struct {
	ID             string      `json:"id,omitempty"  elastic_meta:"_id" elastic_mapping:"id: { type: keyword }"`
	AgentID        string      `json:"agent_id" elastic_mapping:"agent_id: { type: keyword }"`
	ClusterID      string      `json:"cluster_id,omitempty" elastic_mapping:"cluster_id: { type: keyword }"`
	ClusterUuid    string      `json:"cluster_uuid,omitempty" elastic_mapping:"cluster_uuid: { type: keyword }"`
	ClusterName    string      `json:"cluster_name,omitempty" elastic_mapping:"cluster_name: { type: keyword }"`
	NodeUUID       string      `json:"node_uuid,omitempty" elastic_mapping:"node_uuid: { type: keyword }"`
	NodeName       string      `json:"node_name,omitempty" elastic_mapping:"node_name: { type: keyword }"`
	Version        string      `json:"version,omitempty" elastic_mapping:"version: { type: keyword }"`
	Timestamp      int64       `json:"timestamp"`
	PublishAddress string      `json:"publish_address" elastic_mapping:"publish_address: { type: keyword }"`
	HttpPort       string      `json:"http_port"`
	Schema         string      `json:"schema"`
	Status         string      `json:"status" elastic_mapping:"status: { type: keyword }"`
	ProcessInfo    ProcessInfo `json:"process_info" elastic_mapping:"process_info : { type : object, enabled:false }"`
	Path           PathInfo    `json:"path"`
}

es process info with process id

type HardwareInfo

type HardwareInfo struct {
	Memory    interface{} `json:"memory,omitempty" elastic_mapping:"name: { type: object }"`
	Processor interface{} `json:"processor,omitempty" elastic_mapping:"processor: { type: object }"`
	Disk      interface{} `json:"disk,omitempty" elastic_mapping:"disk: { type: object }"`
}

type HostInfo

type HostInfo struct {
	Name     string        `json:"name,omitempty" elastic_mapping:"name: { type: keyword }"`
	OS       OSInfo        `json:"os" elastic_mapping:"os: { type: object }"`
	Hardware *HardwareInfo `json:"hardware,omitempty" elastic_mapping:"hardware: { type: object }"`
}

type Instance

type Instance struct {
	orm.ORMObjectBase

	Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,fields:{text: {type: text}}}"`

	//application information
	Application env.Application `json:"application,omitempty" elastic_mapping:"application: { type: object }"`

	BasicAuth *BasicAuth `config:"basic_auth" json:"basic_auth,omitempty" elastic_mapping:"basic_auth:{type:object}"`

	Labels map[string]string `json:"labels,omitempty" elastic_mapping:"labels:{type:object}"`
	Tags   []string          `json:"tags,omitempty"`

	//user can pass
	Description string `json:"description,omitempty" config:"description" elastic_mapping:"description:{type:keyword}"`

	Endpoint string `json:"endpoint,omitempty" elastic_mapping:"endpoint: { type: keyword }"` //API endpoint

	Host *HostInfo `json:"host,omitempty" elastic_mapping:"host: { type: object }"`

	Network  NetworkInfo   `json:"network,omitempty" elastic_mapping:"network: { type: object }"`
	Services []ServiceInfo `json:"services,omitempty" elastic_mapping:"services: { type: object }"`
	Status   string        `json:"status,omitempty" elastic_mapping:"status: { type: keyword, copy_to:search_text }"`
}

func GetInstanceInfo

func GetInstanceInfo() Instance

func (*Instance) GetEndpoint

func (inst *Instance) GetEndpoint() string

func (*Instance) GetVersion

func (inst *Instance) GetVersion() (map[string]interface{}, error)

type ListenAddr

type ListenAddr struct {
	IP   string `json:"ip"`
	Port int    `json:"port"`
}

type Metadata

type Metadata struct {
	Category string      `json:"category" elastic_mapping:"category: { type: keyword }"`
	Name     string      `json:"name" elastic_mapping:"name: { type: keyword }"`
	Labels   util.MapStr `json:"labels" elastic_mapping:"labels: { type: object }"`
}

type NetworkInfo

type NetworkInfo struct {
	IP      []string `json:"ip,omitempty" elastic_mapping:"ip: { type: keyword,copy_to:search_text }"`
	MajorIP string   `json:"major_ip,omitempty" elastic_mapping:"major_ip: { type: keyword }"`
}

type OSInfo

type OSInfo struct {
	Name         string `json:"name,omitempty" elastic_mapping:"name: { type: keyword }"`
	Architecture string `json:"architecture,omitempty" elastic_mapping:"architecture: { type: keyword }"`
	Version      string `json:"version,omitempty" elastic_mapping:"version: { type: keyword }"`
}

type PathInfo

type PathInfo struct {
	Home   string `json:"home"`
	Data   string `json:"data"`
	Logs   string `json:"logs"`
	Config string `json:"config"`
}

type ProcessInfo

type ProcessInfo struct {
	PID             int          `json:"pid"`
	Name            string       `json:"name"`
	Cmdline         string       `json:"cmdline"`
	CreateTime      int64        `json:"create_time"`
	Status          string       `json:"status"`
	ListenAddresses []ListenAddr `json:"listen_addresses"`
}

type ServiceInfo

type ServiceInfo struct {
	Name     string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,fields:{text: {type: text}}}"`
	Endpoint string `json:"endpoint,omitempty" elastic_mapping:"endpoint: { type: keyword }"`
}

type Setting

type Setting struct {
	orm.ORMObjectBase
	Metadata Metadata    `json:"metadata" elastic_mapping:"metadata: { type: object }"`
	Payload  util.MapStr `json:"payload" elastic_mapping:"payload: { type: object}"`
}

type UserInfo

type UserInfo struct {
	ID   string `json:"id" elastic_mapping:"id: { type: keyword }"`
	Name string `json:"name" elastic_mapping:"name: { type: keyword }"`
}

used for reference in other object only

Jump to

Keyboard shortcuts

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