models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MessageTypeSMS ...
	MessageTypeSMS = MessageType("sms")
	// MessageTypeEmail ...
	MessageTypeEmail = MessageType("email")
	// MessageTypeSlack ...
	MessageTypeSlack = MessageType("slack")
	// MessageTypeUiNotify ...
	MessageTypeUiNotify = MessageType("ui_notify")
	// MessageTypeTelegramNotify ...
	MessageTypeTelegramNotify = MessageType("telegram_notify")
)
View Source
const (
	// MessageStatusNew ...
	MessageStatusNew = MessageStatus("new")
	// MessageStatusInProgress ...
	MessageStatusInProgress = MessageStatus("in_progress")
	// MessageStatusSucceed ...
	MessageStatusSucceed = MessageStatus("succeed")
	// MessageStatusError ...
	MessageStatusError = MessageStatus("error")
)
View Source
const (
	// TemplateStatusActive ...
	TemplateStatusActive = TemplateStatus("active")
	// TemplateStatusUnactive ...
	TemplateStatusUnactive = TemplateStatus("inactive")
	// TemplateTypeItem ...
	TemplateTypeItem = TemplateType("item")
	// TemplateTypeTemplate ...
	TemplateTypeTemplate = TemplateType("template")
)
View Source
const HistoryMax = 8

HistoryMax ...

Variables

This section is empty.

Functions

func PreviewTemplate added in v0.0.17

func PreviewTemplate(items []*Template, template *TemplateContent) (data string, err error)

PreviewTemplate ...

func TemplateGetParents added in v0.0.17

func TemplateGetParents(items Templates, result *Templates, s string)

TemplateGetParents ...

Types

type AlexaIntent added in v0.3.0

type AlexaIntent struct {
	Name         string    `json:"name"`
	AlexaSkillId int64     `json:"alexa_skill_id" valid:"Required"`
	Script       *Script   `json:"script"`
	ScriptId     int64     `json:"script_id" valid:"Required"`
	Description  string    `json:"description"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

AlexaIntent ...

func (*AlexaIntent) Valid added in v0.3.0

func (d *AlexaIntent) Valid() (ok bool, errs []*validation.Error)

Valid ...

type AlexaSkill added in v0.3.0

type AlexaSkill struct {
	Id                   int64             `json:"id"`
	SkillId              string            `json:"skill_id" valid:"Required"`
	Description          string            `json:"description"`
	Status               common.StatusType `json:"status" valid:"Required"`
	Intents              []*AlexaIntent    `json:"intents"`
	OnLaunchScript       *Script           `json:"on_launch_script"`
	OnLaunchScriptId     *int64            `json:"on_launch_script_id"`
	OnSessionEndScript   *Script           `json:"on_session_end_script"`
	OnSessionEndScriptId *int64            `json:"on_session_end_script_id"`
	CreatedAt            time.Time         `json:"created_at"`
	UpdatedAt            time.Time         `json:"updated_at"`
}

AlexaSkill ...

func (*AlexaSkill) Valid added in v0.3.0

func (d *AlexaSkill) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Connection

type Connection struct {
	Uuid          uuid.UUID       `json:"uuid"`
	Name          string          `json:"name" valid:"MaxSize(254)"`
	ElementFrom   uuid.UUID       `json:"element_from" valid:"Required"`
	ElementTo     uuid.UUID       `json:"element_to" valid:"Required"`
	PointFrom     int64           `json:"point_from" valid:"Required"`
	PointTo       int64           `json:"point_to" valid:"Required"`
	Flow          *Flow           `json:"flow"`
	FlowId        int64           `json:"flow_id" valid:"Required"`
	Direction     string          `json:"direction"`
	GraphSettings json.RawMessage `json:"graph_settings"`
	CreatedAt     time.Time       `json:"created_at"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

Connection ...

func (*Connection) Valid

func (d *Connection) Valid() (ok bool, errs []*validation.Error)

Valid ...

type DashboardDeviceStatus added in v0.0.25

type DashboardDeviceStatus struct {
	Id          int64  `json:"id"`
	Description string `json:"description"`
	SystemName  string `json:"system_name"`
	DeviceId    int64  `json:"device_id"`
}

DashboardDeviceStatus ...

type Device

type Device struct {
	Id          int64           `json:"id"`
	Name        string          `json:"name" valid:"MaxSize(254);Required"`
	Description string          `json:"description" valid:"MaxSize(254)"`
	Status      string          `json:"status" valid:"MaxSize(254)"`
	Device      *Device         `json:"device"`
	DeviceId    *int64          `json:"device_id"`
	Node        *Node           `json:"node"`
	Type        DeviceType      `json:"type"`
	Properties  json.RawMessage `json:"properties" valid:"Required"`
	States      []*DeviceState  `json:"states"`
	Actions     []*DeviceAction `json:"actions"`
	Devices     []*Device       `json:"devices"`
	IsGroup     bool            `json:"is_group"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
}

Device ...

func (*Device) SetProperties

func (d *Device) SetProperties(properties interface{}) (ok bool, errs []*validation.Error)

SetProperties ...

func (*Device) SetPropertiesFromMap

func (d *Device) SetPropertiesFromMap(properties map[string]interface{}) (ok bool, errs []*validation.Error, err error)

SetPropertiesFromMap ...

func (*Device) Valid

func (d *Device) Valid() (ok bool, errs []*validation.Error)

Valid ...

type DeviceAction

type DeviceAction struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name" valid:"MaxSize(254);Required"`
	Description string    `json:"description"`
	Device      *Device   `json:"device"`
	DeviceId    int64     `json:"device_id" valid:"Required"`
	Script      *Script   `json:"script"`
	ScriptId    int64     `json:"script_id" valid:"Required"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

DeviceAction ...

func (*DeviceAction) Valid

func (d *DeviceAction) Valid() (ok bool, errs []*validation.Error)

Valid ...

type DeviceState

type DeviceState struct {
	Id          int64     `json:"id"`
	Description string    `json:"description"`
	SystemName  string    `json:"system_name" valid:"MaxSize(254);Required"`
	Device      *Device   `json:"device"`
	DeviceId    int64     `json:"device_id" valid:"Required"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

DeviceState ...

func (*DeviceState) Valid

func (d *DeviceState) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Flow

type Flow struct {
	Id                 int64                `json:"id"`
	Name               string               `json:"name" valid:"MaxSize(254);Required"`
	Description        string               `json:"description" valid:"MaxSize(254)"`
	Status             StatusType           `json:"status" valid:"Required"`
	Workflow           *Workflow            `json:"workflow"`
	WorkflowId         int64                `json:"workflow_id" valid:"Required"`
	WorkflowScenarioId int64                `json:"workflow_scenario_id" valid:"Required"`
	Connections        []*Connection        `json:"connections"`
	FlowElements       []*FlowElement       `json:"flow_elements"`
	Workers            []*Worker            `json:"workers"`
	Subscriptions      []*FlowSubscription  `json:"subscriptions"`
	Zigbee2mqttDevices []*Zigbee2mqttDevice `json:"zigbee2mqtt_devices"`
	CreatedAt          time.Time            `json:"created_at"`
	UpdatedAt          time.Time            `json:"updated_at"`
}

Flow ...

func (*Flow) Valid

func (d *Flow) Valid() (ok bool, errs []*validation.Error)

Valid ...

type FlowElement

type FlowElement struct {
	Uuid          uuid.UUID                 `json:"uuid"`
	Name          string                    `json:"name" valid:"MaxSize(254)"`
	Description   string                    `json:"description"`
	FlowId        int64                     `json:"flow_id" valid:"Required"`
	Script        *Script                   `json:"script"`
	ScriptId      *int64                    `json:"script_id"`
	Status        StatusType                `json:"status" valid:"Required"`
	FlowLink      *int64                    `json:"flow_link"`
	PrototypeType FlowElementsPrototypeType `json:"prototype_type" valid:"Required"`
	GraphSettings FlowElementGraphSettings  `json:"graph_settings"`
	CreatedAt     time.Time                 `json:"created_at"`
	UpdatedAt     time.Time                 `json:"updated_at"`
}

FlowElement ...

func (*FlowElement) Valid

func (d *FlowElement) Valid() (ok bool, errs []*validation.Error)

Valid ...

type FlowElementGraphSettings

type FlowElementGraphSettings struct {
	Position FlowElementGraphSettingsPosition `json:"position"`
}

FlowElementGraphSettings ...

type FlowElementGraphSettingsPosition

type FlowElementGraphSettingsPosition struct {
	Top  int64 `json:"top"`
	Left int64 `json:"left"`
}

FlowElementGraphSettingsPosition ...

type FlowSubscription added in v0.0.21

type FlowSubscription struct {
	Id     int64  `json:"id"`
	FlowId int64  `json:"flow_id"`
	Topic  string `json:"topic"`
}

FlowSubscription ...

type FlowZigbee2mqttDevice added in v0.1.0

type FlowZigbee2mqttDevice struct {
	Id                  int64              `json:"id"`
	Flow                *Flow              `json:"flow"`
	FlowId              int64              `json:"flow_id"`
	Zigbee2mqttDevice   *Zigbee2mqttDevice `json:"zigbee_2_mqtt_device"`
	Zigbee2mqttDeviceId string             `json:"zigbee_2_mqtt_device_id"`
	CreatedAt           time.Time          `json:"created_at"`
}

FlowZigbee2mqttDevice ...

type Image

type Image struct {
	Id        int64     `json:"id"`
	Thumb     string    `json:"thumb"`
	Url       string    `json:"url"`
	Image     string    `json:"image"`
	MimeType  string    `json:"mime_type"`
	Title     string    `json:"title"`
	Size      int64     `json:"size"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
}

Image ...

func (*Image) Valid

func (m *Image) Valid() (ok bool, errs []*validation.Error)

Valid ...

type ImageFilterList

type ImageFilterList struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

ImageFilterList ...

type Log

type Log struct {
	Id        int64           `json:"id"`
	Body      string          `json:"body" valid:"Required"`
	Level     common.LogLevel `json:"level" valid:"Required"`
	CreatedAt time.Time       `json:"created_at"`
}

Log ...

func (*Log) Valid

func (d *Log) Valid() (ok bool, errs []*validation.Error)

Valid ...

type LogQuery

type LogQuery struct {
	StartDate *time.Time `json:"start_date"`
	EndDate   *time.Time `json:"end_date"`
	Levels    []string   `json:"levels"`
}

LogQuery ...

type Map

type Map struct {
	Id          int64       `json:"id"`
	Name        string      `json:"name" valid:"MaxSize(254);Required"`
	Description string      `json:"description" valid:"Required"`
	Options     MapOptions  `json:"options"`
	Layers      []*MapLayer `json:"layers"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

Map ...

func (*Map) Valid

func (m *Map) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapDevice

type MapDevice struct {
	Id        int64              `json:"id"`
	Device    *Device            `json:"device"`
	DeviceId  int64              `json:"device_id" valid:"Required"`
	Image     *Image             `json:"image"`
	ImageId   int64              `json:"image_id"`
	Actions   []*MapDeviceAction `json:"actions"`
	States    []*MapDeviceState  `json:"states"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
}

MapDevice ...

func (*MapDevice) Valid

func (m *MapDevice) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapDeviceAction

type MapDeviceAction struct {
	Id             int64         `json:"id"`
	DeviceAction   *DeviceAction `json:"device_action"`
	DeviceActionId int64         `json:"device_action_id" valid:"Required"`
	MapDeviceId    int64         `json:"map_device_id" valid:"Required"`
	Image          *Image        `json:"image"`
	ImageId        int64         `json:"image_id" valid:"Required"`
	Type           string        `json:"type"`
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
}

MapDeviceAction ...

func (*MapDeviceAction) Valid

func (m *MapDeviceAction) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapDeviceHistory added in v0.2.0

type MapDeviceHistory struct {
	Id           int64                       `json:"id"`
	MapDeviceId  int64                       `json:"map_device_id"`
	MapElement   *MapElement                 `json:"map_element"`
	MapElementId int64                       `json:"map_element_id"`
	LogLevel     common.LogLevel             `json:"log_level"`
	Type         common.MapDeviceHistoryType `json:"type"`
	Description  string                      `json:"description"`
	CreatedAt    time.Time                   `json:"created_at"`
}

MapDeviceHistory ...

type MapDeviceState

type MapDeviceState struct {
	Id            int64        `json:"id"`
	DeviceState   *DeviceState `json:"device_state"`
	DeviceStateId int64        `json:"device_state_id" valid:"Required"`
	MapDeviceId   int64        `json:"map_device_id" valid:"Required"`
	Image         *Image       `json:"image"`
	ImageId       int64        `json:"image_id" valid:"Required"`
	Style         string       `json:"style"`
	CreatedAt     time.Time    `json:"created_at"`
	UpdatedAt     time.Time    `json:"updated_at"`
}

MapDeviceState ...

func (*MapDeviceState) Valid

func (m *MapDeviceState) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapElement

type MapElement struct {
	Id            int64                   `json:"id"`
	Name          string                  `json:"name" valid:"Required"`
	Description   string                  `json:"description"`
	PrototypeId   int64                   `json:"prototype_id"`
	PrototypeType PrototypeType           `json:"prototype_type"`
	Prototype     Prototype               `json:"prototype" valid:"Required"`
	MapId         int64                   `json:"map_id" valid:"Required"`
	LayerId       int64                   `json:"layer_id" valid:"Required"`
	GraphSettings MapElementGraphSettings `json:"graph_settings"`
	Status        StatusType              `json:"status" valid:"Required"`
	Weight        int64                   `json:"weight"`
	Zone          *MapZone                `json:"zone"`
	CreatedAt     time.Time               `json:"created_at"`
	UpdatedAt     time.Time               `json:"updated_at"`
}

MapElement ...

func (*MapElement) Valid

func (m *MapElement) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapElementGraphSettings

type MapElementGraphSettings struct {
	Width    null.Int64                      `json:"width"`
	Height   null.Int64                      `json:"height"`
	Position MapElementGraphSettingsPosition `json:"position"`
}

MapElementGraphSettings ...

type MapElementGraphSettingsPosition

type MapElementGraphSettingsPosition struct {
	Top  int64 `json:"top"`
	Left int64 `json:"left"`
}

MapElementGraphSettingsPosition ...

type MapImage

type MapImage struct {
	Id      int64  `json:"id"`
	Image   *Image `json:"image"`
	ImageId int64  `json:"image_id" valid:"Required"`
	Style   string `json:"style"`
}

MapImage ...

func (*MapImage) Valid

func (m *MapImage) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapLayer

type MapLayer struct {
	Id          int64         `json:"id"`
	Name        string        `json:"name" valid:"MaxSize(254);Required"`
	Description string        `json:"description"`
	Map         *Map          `json:"map"`
	MapId       int64         `json:"map_id" valid:"Required"`
	Status      string        `json:"status" valid:"Required"`
	Weight      int64         `json:"weight"`
	Elements    []*MapElement `json:"elements"`
	CreatedAt   time.Time     `json:"created_at"`
	UpdatedAt   time.Time     `json:"updated_at"`
}

MapLayer ...

func (*MapLayer) Valid

func (m *MapLayer) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapOptions

type MapOptions struct {
	Zoom              float64 `json:"zoom"`
	ElementStateText  bool    `json:"element_state_text"`
	ElementOptionText bool    `json:"element_option_text"`
}

MapOptions ...

type MapText

type MapText struct {
	Id    int64  `json:"id"`
	Text  string `json:"text" valid:"Required"`
	Style string `json:"style"`
}

MapText ...

func (*MapText) Valid

func (m *MapText) Valid() (ok bool, errs []*validation.Error)

Valid ...

type MapZone added in v0.0.14

type MapZone struct {
	Id   int64  `json:"id"`
	Name string `json:"name" valid:"Required"`
}

MapZone ...

func (*MapZone) Valid added in v0.0.14

func (d *MapZone) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Message added in v0.0.17

type Message struct {
	Id           int64       `json:"id"`
	Type         MessageType `json:"type"`
	EmailFrom    *string     `json:"email_from"`
	EmailSubject *string     `json:"email_subject"`
	EmailBody    *string     `json:"email_body"`
	SmsText      *string     `json:"sms_text"`
	UiText       *string     `json:"ui_text"`
	TelegramText *string     `json:"telegram_text"`
	SlackText    *string     `json:"slack_text"`
	CreatedAt    time.Time   `json:"created_at"`
	UpdatedAt    time.Time   `json:"updated_at"`
}

Message ...

type MessageDelivery added in v0.0.17

type MessageDelivery struct {
	Id                 int64         `json:"id"`
	Message            *Message      `json:"message"`
	MessageId          int64         `json:"message_id"`
	Address            string        `json:"address"`
	Status             MessageStatus `json:"status"`
	ErrorMessageStatus *string       `json:"error_message_status"`
	ErrorMessageBody   *string       `json:"error_message_body"`
	CreatedAt          time.Time     `json:"created_at"`
	UpdatedAt          time.Time     `json:"updated_at"`
}

MessageDelivery ...

type MessageStatus added in v0.0.17

type MessageStatus string

MessageStatus ...

type MessageType added in v0.0.17

type MessageType string

MessageType ...

type NewNotifrMessage added in v0.0.17

type NewNotifrMessage struct {
	Type         string                 `json:"type"`
	BodyType     string                 `json:"body_type"`
	EmailFrom    *string                `json:"email_from"`
	EmailSubject *string                `json:"email_subject"`
	EmailBody    *string                `json:"email_body"`
	Template     *string                `json:"template"`
	SmsText      *string                `json:"sms_text"`
	SlackText    *string                `json:"slack_text"`
	TelegramText *string                `json:"telegram_text"`
	Params       map[string]interface{} `json:"params"`
	Address      string                 `json:"address"`
}

NewNotifrMessage ...

type Node

type Node struct {
	Id                int64     `json:"id"`
	Name              string    `json:"name" valid:"MaxSize(254);Required"`
	Status            string    `json:"status" valid:"Required"`
	Description       string    `json:"description"`
	Login             string    `json:"login" valid:"MaxSize(254);Required"`
	Password          string    `json:"password"`
	EncryptedPassword string    `json:"encrypted_password"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

Node ...

func (*Node) Valid

func (d *Node) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Permission

type Permission struct {
	Id          int64  `json:"id"`
	RoleName    string `json:"role_name"`
	PackageName string `json:"package_name"`
	LevelName   string `json:"level_name"`
}

Permission ...

type Prototype

type Prototype struct {
	*MapImage
	*MapText
	*MapDevice
}

Prototype ...

func (Prototype) MarshalJSON

func (n Prototype) MarshalJSON() (b []byte, err error)

MarshalJSON ...

func (*Prototype) UnmarshalJSON

func (n *Prototype) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON ...

type RedactorConnector

type RedactorConnector struct {
	Id    uuid.UUID `json:"id"`
	Start struct {
		Object uuid.UUID `json:"object"`
		Point  int64     `json:"point"`
	} `json:"start"`
	End struct {
		Object uuid.UUID `json:"object"`
		Point  int64     `json:"point"`
	} `json:"end"`
	FlowType  string `json:"flow_type"`
	Title     string `json:"title"`
	Direction string `json:"direction"`
}

RedactorConnector ...

type RedactorFlow

type RedactorFlow struct {
	Id                 int64                `json:"id"`
	Name               string               `json:"name"`
	Description        string               `json:"description"`
	Status             StatusType           `json:"status"`
	Objects            []*RedactorObject    `json:"objects"`
	Connectors         []*RedactorConnector `json:"connectors"`
	CreatedAt          time.Time            `json:"created_at"`
	UpdatedAt          time.Time            `json:"update_at"`
	Workflow           *Workflow            `json:"workflow"`
	Subscriptions      []*FlowSubscription  `json:"subscriptions"`
	Zigbee2mqttDevices []*Zigbee2mqttDevice `json:"zigbee2mqtt_devices"`
	Scenario           *WorkflowScenario    `json:"scenario"`
	Workers            []*Worker            `json:"workers"`
}

RedactorFlow ...

type RedactorGrapSettings

type RedactorGrapSettings struct {
	Position struct {
		Top  int64 `json:"top"`
		Left int64 `json:"left"`
	} `json:"position"`
}

RedactorGrapSettings ...

type RedactorObject

type RedactorObject struct {
	Id   uuid.UUID `json:"id"`
	Type struct {
		Name   string      `json:"name"`
		Start  interface{} `json:"start"`
		End    interface{} `json:"end"`
		Status string      `json:"status"`
		Action string      `json:"action"`
	} `json:"type"`
	Position struct {
		Top  int64 `json:"top"`
		Left int64 `json:"left"`
	} `json:"position"`
	Status        string                    `json:"status"`
	Error         string                    `json:"error"`
	Title         string                    `json:"title"`
	Description   string                    `json:"description"`
	PrototypeType FlowElementsPrototypeType `json:"prototype_type"`
	Script        *Script                   `json:"script"`
	FlowLink      *Flow                     `json:"flow_link"`
}

RedactorObject ...

type Role

type Role struct {
	Name        string              `json:"name" valid:"MaxSize(254);Required"`
	Description string              `json:"description"`
	Parent      *Role               `json:"parent"`
	Children    []*Role             `json:"children"`
	AccessList  map[string][]string `json:"access_list"`
	CreatedAt   time.Time           `json:"created_at"`
	UpdatedAt   time.Time           `json:"updated_at"`
}

Role ...

func (*Role) Valid

func (d *Role) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Script

type Script struct {
	Id          int64      `json:"id"`
	Lang        ScriptLang `json:"lang" valid:"Required"`
	Name        string     `json:"name" valid:"MaxSize(254);Required"`
	Source      string     `json:"source"`
	Description string     `json:"description"`
	Compiled    string     `json:"-"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
}

Script ...

func (*Script) Valid

func (d *Script) Valid() (ok bool, errs []*validation.Error)

Valid ...

type SortMapElement

type SortMapElement struct {
	Id     int64 `json:"id"`
	Weight int64 `json:"weight"`
}

SortMapElement ...

type SortMapElementByWeight

type SortMapElementByWeight []*MapElement

SortMapElementByWeight ...

func (SortMapElementByWeight) Len

func (l SortMapElementByWeight) Len() int

Len ...

func (SortMapElementByWeight) Less

func (l SortMapElementByWeight) Less(i, j int) bool

Less ...

func (SortMapElementByWeight) Swap

func (l SortMapElementByWeight) Swap(i, j int)

Swap ...

type SortMapLayer

type SortMapLayer struct {
	Id     int64 `json:"id"`
	Weight int64 `json:"weight"`
}

SortMapLayer ...

type SortMapLayersByWeight

type SortMapLayersByWeight []*MapLayer

SortMapLayersByWeight ...

func (SortMapLayersByWeight) Len

func (l SortMapLayersByWeight) Len() int

Len ...

func (SortMapLayersByWeight) Less

func (l SortMapLayersByWeight) Less(i, j int) bool

Less ...

func (SortMapLayersByWeight) Swap

func (l SortMapLayersByWeight) Swap(i, j int)

Swap ...

type Template added in v0.0.17

type Template struct {
	Validity
	Name         string         `json:"name" valid:"Required;MaxSize(64)" `
	Description  string         `json:"description"`
	Content      string         `json:"content"`
	Status       TemplateStatus `json:"status" valid:"Required;MaxSize(64)"`
	Type         TemplateType   `json:"type" valid:"Required;MaxSize(64)"`
	ParentsCount int            `json:"parents_count"`
	ParentName   *string        `json:"parent"`
	Markers      []string       `json:"markers"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
}

Template ...

func (*Template) GetMarkers added in v0.0.17

func (i *Template) GetMarkers(items []*Template, template *TemplateContent) (markers []string, err error)

GetMarkers ...

func (*Template) GetTemplate added in v0.0.17

func (i *Template) GetTemplate() (tpl *TemplateContent, err error)

GetTemplate ...

type TemplateContent added in v0.0.17

type TemplateContent struct {
	Items  []string         `json:"items"`
	Title  string           `json:"title"`
	Fields []*TemplateField `json:"fields"`
}

TemplateContent ...

type TemplateField added in v0.0.17

type TemplateField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

TemplateField ...

type TemplateRender added in v0.0.17

type TemplateRender struct {
	Subject string `json:"subject"`
	Body    string `json:"body"`
}

TemplateRender ...

func RenderTemplate added in v0.0.17

func RenderTemplate(items []*Template, template *TemplateContent, params map[string]interface{}) (render *TemplateRender, err error)

RenderTemplate ...

type TemplateStatus added in v0.0.17

type TemplateStatus string

TemplateStatus ...

func (TemplateStatus) String added in v0.0.17

func (s TemplateStatus) String() string

String ...

type TemplateTree added in v0.0.17

type TemplateTree struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Status      string          `json:"status"`
	Nodes       []*TemplateTree `json:"nodes"`
}

TemplateTree ...

type TemplateType added in v0.0.17

type TemplateType string

TemplateType ...

func (TemplateType) String added in v0.0.17

func (t TemplateType) String() string

String ...

type Templates added in v0.0.17

type Templates []*Template

Templates ...

func (Templates) Len added in v0.0.17

func (i Templates) Len() int

Len ...

func (Templates) Less added in v0.0.17

func (i Templates) Less(a, b int) bool

Less ...

func (Templates) Swap added in v0.0.17

func (i Templates) Swap(a, b int)

Swap ...

type User

type User struct {
	Id                  int64          `json:"id"`
	Nickname            string         `json:"nickname" valid:"Required;MinSize(3);MaxSize(255)"`
	FirstName           string         `json:"first_name" valid:"MaxSize(255)"`
	LastName            string         `json:"last_name" valid:"MaxSize(255)"`
	EncryptedPassword   string         `json:"encrypted_password,omitempty"`
	Email               string         `json:"email" valid:"Required;Email"`
	Status              string         `json:"status" valid:"MaxSize(255)"`
	ResetPasswordToken  string         `json:"-,omitempty"`
	AuthenticationToken *string        `json:"authentication_token,omitempty"`
	Image               *Image         `json:"image,omitempty"`
	ImageId             sql.NullInt64  `json:"image_id"`
	SignInCount         int64          `json:"sign_in_count,omitempty"`
	CurrentSignInIp     string         `json:"current_sign_in_ip,omitempty"`
	LastSignInIp        string         `json:"last_sign_in_ip,omitempty"`
	Lang                string         `json:"lang"`
	User                *User          `json:"user,omitempty"`
	UserId              sql.NullInt64  `json:"user_id"`
	Role                *Role          `json:"role"`
	RoleName            string         `json:"role_name,omitempty"`
	Meta                []*UserMeta    `json:"meta,omitempty"`
	ResetPasswordSentAt *time.Time     `json:"reset_password_sent_at,omitempty"`
	CurrentSignInAt     *time.Time     `json:"current_sign_in_at,omitempty"`
	LastSignInAt        *time.Time     `json:"last_sign_in_at,omitempty"`
	CreatedAt           time.Time      `json:"created_at,omitempty"`
	UpdatedAt           time.Time      `json:"updated_at,omitempty"`
	DeletedAt           *time.Time     `json:"deleted_at"`
	History             []*UserHistory `json:"history,omitempty"`
}

User ...

func (User) CheckPass

func (u User) CheckPass(password string) (ok bool)

CheckPass ...

func (*User) SetPass

func (u *User) SetPass(password string) (err error)

SetPass ...

func (*User) UpdateHistory

func (u *User) UpdateHistory(t time.Time, ipv4 string)

UpdateHistory ...

func (*User) Valid

func (u *User) Valid() (ok bool, errs []*validation.Error)

Valid ...

type UserHistory

type UserHistory struct {
	Ip   string    `json:"ip"`
	Time time.Time `json:"time"`
}

UserHistory ...

type UserMeta

type UserMeta struct {
	Id     int64  `json:"id"`
	User   *User  `json:"user"`
	UserId int64  `json:"user_id"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

UserMeta ...

type Validity added in v0.0.17

type Validity struct {
}

Validity ...

func (Validity) Valid added in v0.0.17

func (d Validity) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Variable

type Variable struct {
	Name      string    `json:"name"`
	Value     string    `json:"value"`
	Autoload  bool      `json:"autoload"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Variable ...

func NewVariable added in v0.0.9

func NewVariable(name string) *Variable

NewVariable ...

func (*Variable) GetObj added in v0.0.9

func (v *Variable) GetObj(obj interface{}) (err error)

GetObj ...

func (*Variable) SetObj added in v0.0.9

func (v *Variable) SetObj(obj interface{}) (err error)

SetObj ...

type Version added in v0.0.24

type Version struct {
	Version     string `json:"version"`
	Revision    string `json:"revision"`
	RevisionURL string `json:"revision_url"`
	Generated   string `json:"generated"`
	Developers  string `json:"developers"`
	BuildNum    string `json:"build_num"`
	DockerImage string `json:"docker_image"`
}

Version ...

type Worker

type Worker struct {
	Id             int64         `json:"id"`
	Name           string        `json:"name" valid:"MaxSize(254);Required"`
	Time           string        `json:"time" valid:"Required"`
	Status         string        `json:"status" valid:"Required"`
	Workflow       *Workflow     `json:"workflow"`
	WorkflowId     int64         `json:"workflow_id" valid:"Required"`
	Flow           *Flow         `json:"flow"`
	FlowId         int64         `json:"flow_id" valid:"Required"`
	DeviceAction   *DeviceAction `json:"device_action"`
	DeviceActionId int64         `json:"device_action_id" valid:"Required"`
	Workers        []*Worker     `json:"workers"`
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
}

Worker ...

func (*Worker) Valid

func (d *Worker) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Workflow

type Workflow struct {
	Id          int64               `json:"id"`
	Name        string              `json:"name" valid:"MaxSize(254);Required"`
	Description string              `json:"description"`
	Status      string              `json:"status" valid:"Required"`
	Flows       []*Flow             `json:"flows"`
	Scripts     []*Script           `json:"scripts"`
	Scenario    *WorkflowScenario   `json:"scenario" valid:"Required"`
	Scenarios   []*WorkflowScenario `json:"scenarios"`
	CreatedAt   time.Time           `json:"created_at"`
	UpdatedAt   time.Time           `json:"updated_at"`
}

Workflow ...

func (*Workflow) Valid

func (d *Workflow) Valid() (ok bool, errs []*validation.Error)

Valid ...

type WorkflowScenario

type WorkflowScenario struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name" valid:"MaxSize(254);Required"`
	SystemName string    `json:"system_name" valid:"MaxSize(254);Required"`
	WorkflowId int64     `json:"workflow_id" valid:"Required"`
	Scripts    []*Script `json:"scripts"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

WorkflowScenario ...

func (*WorkflowScenario) Valid

func (d *WorkflowScenario) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Zigbee2mqtt added in v0.1.0

type Zigbee2mqtt struct {
	Id                int64                `json:"id"`
	Name              string               `json:"name" valid:"MaxSize(254);Required"`
	Login             string               `json:"login"`
	Password          *string              `json:"password"`
	EncryptedPassword string               `json:"encrypted_password"`
	Devices           []*Zigbee2mqttDevice `json:"devices"`
	PermitJoin        bool                 `json:"permit_join"`
	BaseTopic         string               `json:"base_topic"`
	CreatedAt         time.Time            `json:"created_at"`
	UpdatedAt         time.Time            `json:"updated_at"`
}

Zigbee2mqtt ...

func (*Zigbee2mqtt) Valid added in v0.1.0

func (d *Zigbee2mqtt) Valid() (ok bool, errs []*validation.Error)

Valid ...

type Zigbee2mqttDevice added in v0.1.0

type Zigbee2mqttDevice struct {
	Id            string    `json:"id"`
	Zigbee2mqttId int64     `json:"zigbee2mqtt_id" valid:"Required"`
	Name          string    `json:"name" valid:"MaxSize(254);Required"`
	Type          string    `json:"type"`
	Model         string    `json:"model"`
	Description   string    `json:"description"`
	Manufacturer  string    `json:"manufacturer"`
	Functions     []string  `json:"functions"`
	ImageUrl      string    `json:"image_url"`
	Status        string    `json:"status"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

Zigbee2mqttDevice ...

func (*Zigbee2mqttDevice) GetImageUrl added in v0.1.0

func (d *Zigbee2mqttDevice) GetImageUrl()

GetImageUrl ...

func (*Zigbee2mqttDevice) Valid added in v0.1.0

func (d *Zigbee2mqttDevice) Valid() (ok bool, errs []*validation.Error)

Valid ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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