Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Make constants more idomatic #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ type (
)

const (
Available AvailableType = 1
Unavailable AvailableType = 2
Available AvailableType = 1 << iota
Unavailable

Monitored StatusType = 0
Unmonitored StatusType = 1
Monitored StatusType = iota
Unmonitored
)

// https://www.zabbix.com/documentation/2.0/manual/appendix/api/host/definitions
Expand Down
4 changes: 2 additions & 2 deletions host_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ type (
)

const (
NotInternal InternalType = 0
Internal InternalType = 1
NotInternal InternalType = iota
Internal
)

// https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostgroup/definitions
Expand Down
8 changes: 4 additions & 4 deletions host_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ type (
)

const (
Agent InterfaceType = 1
SNMP InterfaceType = 2
IPMI InterfaceType = 3
JMX InterfaceType = 4
Agent InterfaceType = 1 << iota
SNMP
IPMI
JMX
)

// https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions
Expand Down
64 changes: 32 additions & 32 deletions item.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,38 @@ type (
)

const (
ZabbixAgent ItemType = 0
SNMPv1Agent ItemType = 1
ZabbixTrapper ItemType = 2
SimpleCheck ItemType = 3
SNMPv2Agent ItemType = 4
ZabbixInternal ItemType = 5
SNMPv3Agent ItemType = 6
ZabbixAgentActive ItemType = 7
ZabbixAggregate ItemType = 8
WebItem ItemType = 9
ExternalCheck ItemType = 10
DatabaseMonitor ItemType = 11
IPMIAgent ItemType = 12
SSHAgent ItemType = 13
TELNETAgent ItemType = 14
Calculated ItemType = 15
JMXAgent ItemType = 16

Float ValueType = 0
Character ValueType = 1
Log ValueType = 2
Unsigned ValueType = 3
Text ValueType = 4

Decimal DataType = 0
Octal DataType = 1
Hexadecimal DataType = 2
Boolean DataType = 3

AsIs DeltaType = 0
Speed DeltaType = 1
Delta DeltaType = 2
ZabbixAgent ItemType = iota
SNMPv1Agent
ZabbixTrapper
SimpleCheck
SNMPv2Agent
ZabbixInternal
SNMPv3Agent
ZabbixAgentActive
ZabbixAggregate
WebItem
ExternalCheck
DatabaseMonitor
IPMIAgent
SSHAgent
TELNETAgent
Calculated
JMXAgent

Float ValueType = iota
Character
Log
Unsigned
Text

Decimal DataType = iota
Octal
Hexadecimal
Boolean

AsIs DeltaType = iota
Speed
Delta
)

// https://www.zabbix.com/documentation/2.0/manual/appendix/api/item/definitions
Expand Down