types

package
v3.1.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FrameworkKey the framework identifier
	FrameworkKey ContextKey = "cmdb_v3_framework"

	// EventHostType the host event
	EventHostType EventType = "cmdb_v3_event_host_type"

	// EventBusinessType the business event
	EventBusinessType EventType = "cmdb_v3_event_business_type"

	// EventModuleType the module event
	EventModuleType EventType = "cmdb_v3_event_module_type"

	// EventModuleTransferType the module transfer event
	EventModuleTransferType EventType = "cmdb_v3_event_moduletransfer_type"

	// EventHostIdentifierType the host identifier
	EventHostIdentifierType EventType = "cmdb_v3_event_hostidentifier_type"

	// EventSetType the set event
	EventSetType EventType = "cmdb_v3_event_set_type"

	// EventInstType the custom inst event
	EventInstType EventType = "cmdb_v3_event_inst_type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey string

ContextKey the context key type

type Event

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

Event the cmdb event definition

func (*Event) GetAction

func (cli *Event) GetAction() string

GetAction return the event action

func (*Event) GetActionTime

func (cli *Event) GetActionTime() time.Time

GetActionTime get the action time

func (*Event) GetCurrData

func (cli *Event) GetCurrData() MapStr

GetCurrData get the event data

func (*Event) GetPreData

func (cli *Event) GetPreData() MapStr

GetPreData get the event data

func (*Event) SetAction

func (cli *Event) SetAction(action string)

SetAction set the event action

func (*Event) SetActionTime

func (cli *Event) SetActionTime(tm time.Time)

SetActionTime set the action time

func (*Event) SetCurrData

func (cli *Event) SetCurrData(data MapStr)

SetCurrData set the event data

func (*Event) SetPreData

func (cli *Event) SetPreData(data MapStr)

SetPreData set the event data

type EventCallbackFunc

type EventCallbackFunc func(evn []*Event) error

EventCallbackFunc the event deal function

type EventKey

type EventKey string

EventKey the event key type

func (EventKey) Compare

func (cli EventKey) Compare(target EventKey) int

Compare compare the event key

type EventType

type EventType string

EventType CMDB event definition

type MapStr

type MapStr map[string]interface{}

MapStr the common event data definition

func (MapStr) Bool

func (cli MapStr) Bool(key string) bool

Bool get the value as bool

func (MapStr) Different

func (cli MapStr) Different(target MapStr) (more MapStr, less MapStr, changes MapStr)

Different the current value is different from the content of the given data

func (MapStr) Exists

func (cli MapStr) Exists(key string) bool

Exists check the key exists

func (MapStr) Float

func (cli MapStr) Float(key string) (float64, error)

Float get the value as float64

func (MapStr) ForEach

func (cli MapStr) ForEach(callItem func(key string, val interface{}))

ForEach for each the every item

func (MapStr) Get

func (cli MapStr) Get(key string) (val interface{}, exists bool)

Get return the origin value by the key

func (MapStr) Int

func (cli MapStr) Int(key string) (int, error)

Int return the value by the key

func (MapStr) Int64

func (cli MapStr) Int64(key string) (int64, error)

Int64 return the value by the key

func (MapStr) IsEmpty

func (cli MapStr) IsEmpty() bool

IsEmpty check the empty status

func (MapStr) MapStr

func (cli MapStr) MapStr(key string) (MapStr, error)

MapStr get the MapStr object

func (MapStr) MapStrArray

func (cli MapStr) MapStrArray(key string) ([]MapStr, error)

MapStrArray get the MapStr object array

func (MapStr) Merge

func (cli MapStr) Merge(second MapStr)

Merge merge second into self,if the key is the same then the new value replaces the old value.

func (MapStr) Remove

func (cli MapStr) Remove(key string) interface{}

Remove delete the item by the key and return the deleted one

func (MapStr) Reset

func (cli MapStr) Reset()

Reset reset the mapstr into the init state

func (MapStr) Set

func (cli MapStr) Set(key string, value interface{})

Set set a new value for the key, the old value will be replaced

func (MapStr) String

func (cli MapStr) String(key string) string

String get the value as string

func (MapStr) Time

func (cli MapStr) Time(key string) (*time.Time, error)

Time get the value as time.Time

func (MapStr) ToJSON

func (cli MapStr) ToJSON() []byte

ToJSON convert to json string

Jump to

Keyboard shortcuts

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