{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package model\n\n## Types\n\n```go\ntype BasicAuth struct {\n\tUsername string `json:\"username,omitempty\" config:\"username\" elastic_mapping:\"username:{type:keyword}\"`\n\t//password should not be logged, neither in json nor in log\n\tPassword ucfg.SecretString `json:\"password,omitempty\" config:\"password\" yaml:\"password\" elastic_mapping:\"password:{type:keyword}\"`\n}\n```\n\n```go\ntype ESNodeInfo struct {\n\tID             string      `json:\"id,omitempty\"  elastic_meta:\"_id\" elastic_mapping:\"id: { type: keyword }\"`\n\tAgentID        string      `json:\"agent_id\" elastic_mapping:\"agent_id: { type: keyword }\"`\n\tClusterID      string      `json:\"cluster_id,omitempty\" elastic_mapping:\"cluster_id: { type: keyword }\"`\n\tClusterUuid    string      `json:\"cluster_uuid,omitempty\" elastic_mapping:\"cluster_uuid: { type: keyword }\"`\n\tClusterName    string      `json:\"cluster_name,omitempty\" elastic_mapping:\"cluster_name: { type: keyword }\"`\n\tNodeUUID       string      `json:\"node_uuid,omitempty\" elastic_mapping:\"node_uuid: { type: keyword }\"`\n\tNodeName       string      `json:\"node_name,omitempty\" elastic_mapping:\"node_name: { type: keyword }\"`\n\tVersion        string      `json:\"version,omitempty\" elastic_mapping:\"version: { type: keyword }\"`\n\tTimestamp      int64       `json:\"timestamp\"`\n\tPublishAddress string      `json:\"publish_address\" elastic_mapping:\"publish_address: { type: keyword }\"`\n\tHttpPort       string      `json:\"http_port\"`\n\tSchema         string      `json:\"schema\"`\n\tStatus         string      `json:\"status\" elastic_mapping:\"status: { type: keyword }\"`\n\tProcessInfo    ProcessInfo `json:\"process_info\" elastic_mapping:\"process_info : { type : object, enabled:false }\"`\n\tPath           PathInfo    `json:\"path\"`\n}\n```\nes process info with process id\n\n```go\ntype HardwareInfo struct {\n\tMemory    interface{} `json:\"memory,omitempty\" elastic_mapping:\"name: { type: object }\"`\n\tProcessor interface{} `json:\"processor,omitempty\" elastic_mapping:\"processor: { type: object }\"`\n\tDisk      interface{} `json:\"disk,omitempty\" elastic_mapping:\"disk: { type: object }\"`\n}\n```\n\n```go\ntype HostInfo struct {\n\tName     string        `json:\"name,omitempty\" elastic_mapping:\"name: { type: keyword }\"`\n\tOS       OSInfo        `json:\"os\" elastic_mapping:\"os: { type: object }\"`\n\tHardware *HardwareInfo `json:\"hardware,omitempty\" elastic_mapping:\"hardware: { type: object }\"`\n}\n```\n\n```go\ntype Instance struct {\n\torm.ORMObjectBase\n\n\tName string `json:\"name,omitempty\" elastic_mapping:\"name:{type:keyword,fields:{text: {type: text}}}\"`\n\n\t//application information\n\tApplication env.Application `json:\"application,omitempty\" elastic_mapping:\"application: { type: object }\"`\n\n\tBasicAuth *BasicAuth `config:\"basic_auth\" json:\"basic_auth,omitempty\" elastic_mapping:\"basic_auth:{type:object}\"`\n\n\tLabels map[string]string `json:\"labels,omitempty\" elastic_mapping:\"labels:{type:object}\"`\n\tTags   []string          `json:\"tags,omitempty\"`\n\n\t//user can pass\n\tDescription string `json:\"description,omitempty\" config:\"description\" elastic_mapping:\"description:{type:keyword}\"`\n\n\tEndpoint string `json:\"endpoint,omitempty\" elastic_mapping:\"endpoint: { type: keyword }\"` //API endpoint\n\n\tHost *HostInfo `json:\"host,omitempty\" elastic_mapping:\"host: { type: object }\"`\n\n\tNetwork  NetworkInfo   `json:\"network,omitempty\" elastic_mapping:\"network: { type: object }\"`\n\tServices []ServiceInfo `json:\"services,omitempty\" elastic_mapping:\"services: { type: object }\"`\n\tStatus   string        `json:\"status,omitempty\" elastic_mapping:\"status: { type: keyword, copy_to:search_text }\"`\n}\n```\n\n```go\nfunc GetInstanceInfo() Instance\n```\n\n```go\nfunc (inst *Instance) GetEndpoint() string\n```\n\n```go\nfunc (inst *Instance) GetVersion() (map[string]interface{}, error)\n```\n\n```go\ntype ListenAddr struct {\n\tIP   string `json:\"ip\"`\n\tPort int    `json:\"port\"`\n}\n```\n\n```go\ntype Metadata struct {\n\tCategory string      `json:\"category\" elastic_mapping:\"category: { type: keyword }\"`\n\tName     string      `json:\"name\" elastic_mapping:\"name: { type: keyword }\"`\n\tLabels   util.MapStr `json:\"labels\" elastic_mapping:\"labels: { type: object }\"`\n}\n```\n\n```go\ntype NetworkInfo struct {\n\tIP      []string `json:\"ip,omitempty\" elastic_mapping:\"ip: { type: keyword,copy_to:search_text }\"`\n\tMajorIP string   `json:\"major_ip,omitempty\" elastic_mapping:\"major_ip: { type: keyword }\"`\n}\n```\n\n```go\ntype OSInfo struct {\n\tName         string `json:\"name,omitempty\" elastic_mapping:\"name: { type: keyword }\"`\n\tArchitecture string `json:\"architecture,omitempty\" elastic_mapping:\"architecture: { type: keyword }\"`\n\tVersion      string `json:\"version,omitempty\" elastic_mapping:\"version: { type: keyword }\"`\n}\n```\n\n```go\ntype PathInfo struct {\n\tHome   string `json:\"home\"`\n\tData   string `json:\"data\"`\n\tLogs   string `json:\"logs\"`\n\tConfig string `json:\"config\"`\n}\n```\n\n```go\ntype ProcessInfo struct {\n\tPID             int          `json:\"pid\"`\n\tName            string       `json:\"name\"`\n\tCmdline         string       `json:\"cmdline\"`\n\tCreateTime      int64        `json:\"create_time\"`\n\tStatus          string       `json:\"status\"`\n\tListenAddresses []ListenAddr `json:\"listen_addresses\"`\n}\n```\n\n```go\ntype ServiceInfo struct {\n\tName     string `json:\"name,omitempty\" elastic_mapping:\"name:{type:keyword,fields:{text: {type: text}}}\"`\n\tEndpoint string `json:\"endpoint,omitempty\" elastic_mapping:\"endpoint: { type: keyword }\"`\n}\n```\n\n```go\ntype Setting struct {\n\torm.ORMObjectBase\n\tMetadata Metadata    `json:\"metadata\" elastic_mapping:\"metadata: { type: object }\"`\n\tPayload  util.MapStr `json:\"payload\" elastic_mapping:\"payload: { type: object}\"`\n}\n```\n\n```go\ntype UserInfo struct {\n\tID   string `json:\"id\" elastic_mapping:\"id: { type: keyword }\"`\n\tName string `json:\"name\" elastic_mapping:\"name: { type: keyword }\"`\n}\n```\nused for reference in other object only\n\n","path":"github.com/infinitbyte/framework/core/model","name":"model","synopsis":"","isRedistributable":true}
