fiware

package module
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 5 Imported by: 0

README

FIWARE toolkit

Herramienta de línea de comandos

Este repositorio es el hogar de la aplicación warpcom-fiware, que simplifica la operación de los recursos gestionados por un entorno de Thiking Cities basado en plataforma FIWARE. La aplicación permite:

  • Mantener un inventario de entornos FIWARE (SaaS, on premise, IaaS), con diferentes servicios y usuarios.
  • Descargar recursos (entidades, suscripciones, reglas de CEP, etc) de un entorno FIWARE.
  • Subir recursos a un entorno FIWARE.
  • Borrar recursos de un entorno FIWARE.

Modelo de datos

La apicación utiliza las APIs públicas de la plataforma FIWARE para implementar sus funcionalidades. Cada recurso de la plataforma se modela como un objeto son, descrito por el módulo golang github.com/warpcomdev/fiware. Este modelo está representa reecursos como:

  • Name-mappings de cygnus
  • Suscripciones de Context-Broker
  • Services y Devices del IoTAgent-manager
  • Reglas CEP de Perseo
  • Tablas de la base de datos

El modelo se ha construido con cuatro premisas:

  • El modelo global debe ser serializable a json.

  • El modelo debe ser compatible con la API del componente de plataforma relevante en cada caso.

    Por ejemplo, para los recursos relacionados con el IoTAgent-Manager, se modelan dos objetos separados (Services y Devices) siguiendo la lógica de la API del IoTAgent-Manager, que tiene dos endpoints separados para gestionar estos recursos (/iot/services e /iot/devices). El schema de los objetos Services y Devices coincide con el formato que esperan ambas operaciones de la API del IoTAgent-manager.

  • El modelo debe ser útil tanto para leer recursos de la plataforma, como para actualizarlos.

    Los atributos de cada modelo que sólo son relevantes para lectura (por ejemplo, la fecha de último disparo de una suscripción, que puede leerse pero no escribirse) se modelan como una sub-estructura opcional dentro de la estructura que define el recurso.

  • El modelo debe ser compatible con urbo-deployer.

El schema del modelo resultante se ha documentado formalmente en el fichero serializations.cue. La especificación utiliza el lenguaje cue. La versión actual del schema se ha generado automáticamente a partir del código, aunque a futuro podría ser alrevés y ser el código el que se autogenerase en función del schema.

Documentation

Overview

El paquete deployer define los modelos de datos básicos de urbo-deployer. El principal modelo es el de Vertical, que es el punto de entrada a partir del cual se accede al conjunto de datos de la vertical. El resto de tipos corresponden a sub-atributos dentro de la vertical.

Index

Constants

View Source
const (
	LongtermNone      LongtermKind = ""
	LongtermCounter                = "counter"
	LongtermGauge                  = "gauge"
	LongtermEnum                   = "enum"
	LongtermModal                  = "modal"
	LongtermDimension              = "dimension"
)

Variables

This section is empty.

Functions

func SummaryOf added in v0.3.7

func SummaryOf[V any](items map[string]V, summary func(k string, v V) string) []string

SummaryOf makes a summary of every item in the list

func ValuesOf added in v0.3.7

func ValuesOf[V any](items map[string]V) []V

Types

type Attribute

type Attribute struct {
	Name        string          `json:"name"`
	Type        string          `json:"type"`
	Description []string        `json:"description,omitempty"`
	Value       json.RawMessage `json:"value,omitempty" compact:"true"`
	Metadatas   json.RawMessage `json:"metadatas,omitempty" compact:"true"`
	// Si la entidad es Singleton, este atributo se puede marcar
	// como parte de la identidad del singleton, y se añadirá a la
	// primary key de la tabla.
	SingletonKey bool `json:"singletonKey,omitempty"`
	// Indica si este atributo forma parte d ela simulación
	Simulated bool `json:"simulated,omitempty"`
	// Indica si este atributo debe conservarse de alguna forma en longterm
	Longterm LongtermKind `json:"longterm,omitempty"`
	// Si longterm == LongtermEnum, estas serían las opciones
	LongtermOptions []string `json:"longtermOptions,omitempty" sort:"true"`
}

Attribute representa un atributo de una entidad

func (Attribute) MarshalJSON added in v0.1.8

func (x Attribute) MarshalJSON() ([]byte, error)

func (Attribute) Serialize added in v0.1.5

func (x Attribute) Serialize(s serialize.Serializer)

type AttributeMapping

type AttributeMapping struct {
	OriginalAttributeName string `json:"originalAttributeName,omitempty"`
	OriginalAttributeType string `json:"originalAttributeType,omitempty"`
	NewAttributeName      string `json:"newAttributeName,omitempty"`
	NewAttributeType      string `json:"newAttributeType,omitempty"`
}

AttributeMapping es cada uno de los AttributeMappings de un EntityMapping

func (AttributeMapping) MarshalJSON added in v0.1.8

func (x AttributeMapping) MarshalJSON() ([]byte, error)

func (AttributeMapping) Serialize added in v0.1.5

func (x AttributeMapping) Serialize(s serialize.Serializer)

type DeploymentManifest added in v0.3.7

type DeploymentManifest struct {
	Sources map[string]ManifestSource `json:"sources,omitempty"`
}

func (DeploymentManifest) IsEmpty added in v0.3.7

func (d DeploymentManifest) IsEmpty() bool

func (DeploymentManifest) MarshalJSON added in v0.3.7

func (x DeploymentManifest) MarshalJSON() ([]byte, error)

func (DeploymentManifest) Serialize added in v0.3.7

func (x DeploymentManifest) Serialize(s serialize.Serializer)

type Device

type Device struct {
	DeviceId           string            `json:"device_id"`
	APIKey             string            `json:"apikey,omitempty"`
	EntityName         string            `json:"entity_name,omitempty"`
	EntityType         string            `json:"entity_type"`
	Polling            bool              `json:"polling,omitempty"`
	Transport          string            `json:"transport"`
	Timestamp          bool              `json:"timestamp,omitempty"`
	Endpoint           string            `json:"endpoint,omitempty"`
	Attributes         []DeviceAttribute `json:"attributes,omitempty"`
	Lazy               []DeviceAttribute `json:"lazy,omitempty"`
	Commands           []DeviceCommand   `json:"commands,omitempty"`
	StaticAttributes   []DeviceAttribute `json:"static_attributes,omitempty"`
	Protocol           string            `json:"protocol"`
	ExpressionLanguage string            `json:"expressionLanguage,omitempty"`
	ExplicitAttrs      json.RawMessage   `json:"explicitAttrs,omitempty"`
	DeviceStatus
}

Device representa un dispositivo

func (Device) MarshalJSON added in v0.1.8

func (x Device) MarshalJSON() ([]byte, error)

func (Device) Serialize added in v0.1.5

func (x Device) Serialize(s serialize.Serializer)

type DeviceAttribute

type DeviceAttribute struct {
	ObjectId   string          `json:"object_id"`
	Name       string          `json:"name"`
	Type       string          `json:"type,omitempty"`
	Value      json.RawMessage `json:"value,omitempty"` // para los staticAttribs
	Expression string          `json:"expression,omitempty"`
	EntityName string          `json:"entity_name,omitempty"`
	EntityType string          `json:"entity_type,omitempty"`
}

DeviceAttribute describe un atributo de dispositivo

func (DeviceAttribute) MarshalJSON added in v0.1.8

func (x DeviceAttribute) MarshalJSON() ([]byte, error)

func (DeviceAttribute) Serialize added in v0.1.5

func (x DeviceAttribute) Serialize(s serialize.Serializer)

type DeviceCommand

type DeviceCommand struct {
	ObjectId string          `json:"object_id,omitempty"`
	Name     string          `json:"name,omitempty"`
	Type     string          `json:"type,omitempty"`
	Value    string          `json:"value,omitempty"`
	MQTT     json.RawMessage `json:"mqtt,omitempty"`
}

DeviceCommand describe un comando de dispositivo

func (DeviceCommand) MarshalJSON added in v0.1.8

func (x DeviceCommand) MarshalJSON() ([]byte, error)

func (DeviceCommand) Serialize added in v0.1.5

func (x DeviceCommand) Serialize(s serialize.Serializer)

type DeviceStatus

type DeviceStatus struct {
	Service     string `json:"service,omitempty"`
	ServicePath string `json:"service_path,omitempty"`
}

GroupStatus agrupa atributos de estado que no se usan al crear un Device

func (DeviceStatus) MarshalJSON added in v0.1.8

func (x DeviceStatus) MarshalJSON() ([]byte, error)

func (DeviceStatus) Serialize added in v0.1.5

func (x DeviceStatus) Serialize(s serialize.Serializer)

type Entity

type Entity struct {
	ID   string `json:"entityID"`
	Type string `json:"entityType"`
	// Aquí no hace falta mantener el orden,
	// porque el orden correcto de los atributos ya
	// está en el EntityType.
	// Los Metadatas se sacan aparte porque generalmente
	// el json generado es más tratable de esta forma
	Attrs     map[string]json.RawMessage `json:"attrs" compact:"true"`
	MetaDatas map[string]json.RawMessage `json:"metadatas,omitempty" compact:"true"`
}

Entity representa una instancia de EntityType

func (Entity) MarshalJSON added in v0.1.8

func (x Entity) MarshalJSON() ([]byte, error)

func (Entity) Serialize added in v0.1.5

func (x Entity) Serialize(s serialize.Serializer)

type EntityMapping

type EntityMapping struct {
	OriginalEntityId   string             `json:"originalEntityId,omitempty"`
	NewEntityId        string             `json:"newEntityId,omitempty"`
	OriginalEntityType string             `json:"originalEntityType,omitempty"`
	NewEntityType      string             `json:"newEntityType,omitempty"`
	AttributeMappings  []AttributeMapping `json:"attributeMappings"`
}

EntityMaping es cada uno de los EntityMappings de un servicePathMapping

func (EntityMapping) MarshalJSON added in v0.1.8

func (x EntityMapping) MarshalJSON() ([]byte, error)

func (EntityMapping) Serialize added in v0.1.5

func (x EntityMapping) Serialize(s serialize.Serializer)

type EntityType added in v0.1.2

type EntityType struct {
	ID   string `json:"entityID,omitempty"`
	Type string `json:"entityType"`
	// Usamos una lista en vez de un map para poder
	// establecer un orden específico, por si nos interesa
	// conservar el orden de atributos para algo.
	Attrs []Attribute `json:"attrs"`
}

EntityType representa un tipo de entidad

func (EntityType) MarshalJSON added in v0.1.8

func (x EntityType) MarshalJSON() ([]byte, error)

func (EntityType) Serialize added in v0.1.5

func (x EntityType) Serialize(s serialize.Serializer)

type Environment added in v0.3.7

type Environment struct {
	NotificationEndpoints map[string]string `json:"notificationEndpoints"`
}

Environment settings

func (Environment) IsEmpty added in v0.3.7

func (e Environment) IsEmpty() bool

Environment is empty?

func (Environment) MarshalJSON added in v0.3.7

func (x Environment) MarshalJSON() ([]byte, error)

func (Environment) Serialize added in v0.3.7

func (x Environment) Serialize(s serialize.Serializer)

type GroupStatus

type GroupStatus struct {
	ID          string `json:"_id,omitempty"`
	V           int    `json:"__v,omitempty"`
	IOTAgent    string `json:"iotagent,omitempty"`
	ServicePath string `json:"service_path,omitempty"`
	Service     string `json:"service,omitempty"`
	CBHost      string `json:"cbHost,omitempty"`
}

GroupStatus agrupa atributos de estado que no se usan al crear un Service

func (GroupStatus) MarshalJSON added in v0.1.8

func (x GroupStatus) MarshalJSON() ([]byte, error)

func (GroupStatus) Serialize added in v0.1.5

func (x GroupStatus) Serialize(s serialize.Serializer)

type LongtermKind added in v0.2.9

type LongtermKind string

type Manifest added in v0.3.7

type Manifest struct {
	Name       string `json:"name,omitempty"`       // `tourism`, `wifi`, `watermeter`, etc
	Subservice string `json:"subservice,omitempty"` // `turismo`, `wifi`, `contadores`, etc.
	// Tipos de entidad definidos en la vertical.
	// El ID y los valores de los atributos son opcionales.
	EntityTypes []EntityType `json:"entityTypes,omitempty"`
	// Entidades específicas de alguno de los tipos anteriores
	Entities []Entity `json:"entities,omitempty"`
	// Contenidos compatibles con urbo-deployer
	Environment    Environment             `json:"environment,omitempty"`
	Deployment     DeploymentManifest      `json:"deployment,omitempty"`
	ManifestPanels PanelManifest           `json:"panels,omitempty"`
	Subscriptions  map[string]Subscription `json:"subscriptions,omitempty"`
	Rules          map[string]Rule         `json:"rules,omitempty"`
	Verticals      map[string]Vertical     `json:"verticals,omitempty"`
	Services       []Service               `json:"services,omitempty"`
	Devices        []Device                `json:"devices,omitempty"`
	Registrations  []Registration          `json:"registrations,omitempty"`
	// Solo por compatibilidad con urbo-deployer, no se usan
	SQL  json.RawMessage `json:"sql,omitempty"`
	Cdas json.RawMessage `json:"cdas,omitempty"`
	Etls json.RawMessage `json:"etls,omitempty"`
	// Otros datos de estado no asociados al manifest
	ServiceMappings []ServiceMapping     `json:"serviceMappings,omitempty"`
	Projects        []Project            `json:"projects,omitempty"`
	Panels          map[string]UrboPanel `json:"urboPanels,omitempty"`
	Tables          []Table              `json:"tables,omitempty"`
	Views           []View               `json:"views,omitempty"`
}

Manifest representa un manifiesto de vertical

func (*Manifest) ClearStatus added in v0.3.7

func (m *Manifest) ClearStatus()

func (Manifest) MarshalJSON added in v0.3.7

func (x Manifest) MarshalJSON() ([]byte, error)

func (Manifest) Serialize added in v0.3.7

func (x Manifest) Serialize(s serialize.Serializer)

type ManifestSource added in v0.3.7

type ManifestSource struct {
	Path  string   `json:"path,omitempty"`
	Files []string `json:"files,omitempty"`
}

func (ManifestSource) MarshalJSON added in v0.3.7

func (x ManifestSource) MarshalJSON() ([]byte, error)

func (ManifestSource) Serialize added in v0.3.7

func (x ManifestSource) Serialize(s serialize.Serializer)

type Notification

type Notification struct {
	Attrs            []string               `json:"attrs,omitempty" sort:"true" compact:"true"`
	ExceptAttrs      []string               `json:"exceptAttrs,omitempty" sort:"true" compact:"true"`
	AttrsFormat      string                 `json:"attrsFormat"`
	HTTP             NotificationHTTP       `json:"http,omitempty"`
	HTTPCustom       NotificationCustom     `json:"httpCustom,omitempty"`
	MQTT             NotificationMQTT       `json:"mqtt,omitempty"`
	MQTTCustom       NotificationMQTTCustom `json:"mqttCustom,omitempty"`
	OnlyChangedAttrs bool                   `json:"onlyChangedAttrs,omitempty"`
	Covered          bool                   `json:"covered,omitempty"`
	NotificationStatus
}

Notification es la configuración de notificación de la suscripción

func (Notification) MarshalJSON added in v0.1.8

func (x Notification) MarshalJSON() ([]byte, error)

func (Notification) Serialize added in v0.1.5

func (x Notification) Serialize(s serialize.Serializer)

type NotificationCustom

type NotificationCustom struct {
	URL     string            `json:"url"`
	Timeout int               `json:"timeout,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Qs      map[string]string `json:"qs,omitempty"`
	Method  string            `json:"method,omitempty"`
	Payload json.RawMessage   `json:"payload,omitempty" compact:"true"`
	Json    json.RawMessage   `json:"json,omitempty" compact:"true"`
	NGSI    json.RawMessage   `json:"ngsi,omitempty" compact:"true"`
}

NotificationHTTP son los datos de una notificacion

func (NotificationCustom) IsEmpty added in v0.1.5

func (n NotificationCustom) IsEmpty() bool

func (NotificationCustom) MarshalJSON added in v0.1.8

func (x NotificationCustom) MarshalJSON() ([]byte, error)

func (NotificationCustom) Serialize added in v0.1.5

func (x NotificationCustom) Serialize(s serialize.Serializer)

type NotificationHTTP

type NotificationHTTP struct {
	URL     string `json:"url"`
	Timeout int    `json:"timeout,omitempty"`
}

NotificationHTTP son los datos de una notificacion

func (NotificationHTTP) IsEmpty added in v0.1.5

func (n NotificationHTTP) IsEmpty() bool

func (NotificationHTTP) MarshalJSON added in v0.1.8

func (x NotificationHTTP) MarshalJSON() ([]byte, error)

func (NotificationHTTP) Serialize added in v0.1.5

func (x NotificationHTTP) Serialize(s serialize.Serializer)

type NotificationMQTT added in v0.3.7

type NotificationMQTT struct {
	URL    string `json:"url"`
	Topic  string `json:"topic"`
	QoS    string `json:"qos,omitempty"`
	User   string `json:"user,omitempty"`
	Passwd string `json:"passwd,omitempty"`
}

NotificationMQTT son los datos de una notificacion MQTT

func (NotificationMQTT) IsEmpty added in v0.3.7

func (n NotificationMQTT) IsEmpty() bool

func (NotificationMQTT) MarshalJSON added in v0.3.7

func (x NotificationMQTT) MarshalJSON() ([]byte, error)

func (NotificationMQTT) Serialize added in v0.3.7

func (x NotificationMQTT) Serialize(s serialize.Serializer)

type NotificationMQTTCustom added in v0.3.7

type NotificationMQTTCustom struct {
	URL     string          `json:"url"`
	Topic   string          `json:"topic"`
	QoS     int             `json:"qos,omitempty"`
	User    string          `json:"user,omitempty"`
	Passwd  string          `json:"passwd,omitempty"`
	Payload json.RawMessage `json:"payload,omitempty" compact:"true"`
	Json    json.RawMessage `json:"json,omitempty" compact:"true"`
	NGSI    json.RawMessage `json:"ngsi,omitempty" compact:"true"`
}

NotificationMQTTCustom son los datos de una notificacion MQTT Custom

func (NotificationMQTTCustom) IsEmpty added in v0.3.7

func (n NotificationMQTTCustom) IsEmpty() bool

func (NotificationMQTTCustom) MarshalJSON added in v0.3.7

func (x NotificationMQTTCustom) MarshalJSON() ([]byte, error)

func (NotificationMQTTCustom) Serialize added in v0.3.7

type NotificationStatus

type NotificationStatus struct {
	LastFailure       string `json:"lastFailure,omitempty"`
	LastFailureReason string `json:"lastFailureReason,omitempty"`
	LastNotification  string `json:"lastNotification,omitempty"`
	LastSuccess       string `json:"lastSuccess,omitempty"`
	LastSuccessCode   int    `json:"lastSuccessCode,omitempty"`
	FailsCounter      int    `json:"failsCounter,omitempty"`
	TimesSent         int    `json:"timesSent,omitempty"`
}

NotificationStatus agrupa los datos de estado de la suscripción

func (NotificationStatus) MarshalJSON added in v0.1.8

func (x NotificationStatus) MarshalJSON() ([]byte, error)

func (NotificationStatus) Serialize added in v0.1.5

func (x NotificationStatus) Serialize(s serialize.Serializer)

type PanelManifest added in v0.3.7

type PanelManifest struct {
	Sources map[string]ManifestSource `json:"sources,omitempty"`
}

func (PanelManifest) IsEmpty added in v0.3.7

func (p PanelManifest) IsEmpty() bool

func (PanelManifest) MarshalJSON added in v0.3.7

func (x PanelManifest) MarshalJSON() ([]byte, error)

func (PanelManifest) Serialize added in v0.3.7

func (x PanelManifest) Serialize(s serialize.Serializer)

type Project added in v0.2.6

type Project struct {
	IsDomain    bool            `json:"is_domain"`
	Description string          `json:"description,omitempty"`
	Tags        json.RawMessage `json:"tags,omitempty"`
	Enabled     bool            `json:"enabled"`
	ID          string          `json:"id"`
	ParentId    string          `json:"parent_id,omitempty"`
	DomainId    string          `json:"domain_id,omitempty"`
	Name        string          `json:"name"`
	ProjectStatus
}

func (Project) MarshalJSON added in v0.2.6

func (x Project) MarshalJSON() ([]byte, error)

func (Project) Serialize added in v0.2.6

func (x Project) Serialize(s serialize.Serializer)

type ProjectStatus added in v0.2.6

type ProjectStatus struct {
	Links json.RawMessage `json:"links,omitempty"`
}

func (ProjectStatus) MarshalJSON added in v0.2.6

func (x ProjectStatus) MarshalJSON() ([]byte, error)

func (ProjectStatus) Serialize added in v0.2.6

func (x ProjectStatus) Serialize(s serialize.Serializer)

type Registration added in v0.3.5

type Registration struct {
	ID           string          `json:"id"`
	Description  string          `json:"description,omitemty"`
	DataProvided json.RawMessage `json:"dataProvided,omitempty"`
	Provider     json.RawMessage `json:"provider,omitempty"`
	RegistrationStatus
}

Registration representa un registro

func (Registration) MarshalJSON added in v0.3.5

func (x Registration) MarshalJSON() ([]byte, error)

func (Registration) Serialize added in v0.3.5

func (x Registration) Serialize(s serialize.Serializer)

type RegistrationStatus added in v0.3.5

type RegistrationStatus struct {
	Status string `json:"status"`
}

func (RegistrationStatus) MarshalJSON added in v0.3.5

func (x RegistrationStatus) MarshalJSON() ([]byte, error)

func (RegistrationStatus) Serialize added in v0.3.5

func (x RegistrationStatus) Serialize(s serialize.Serializer)

type Rule

type Rule struct {
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Misc        string          `json:"misc,omitempty"`
	Text        string          `json:"text,omitempty"`
	VR          string          `json:"VR,omitempty"`
	Action      json.RawMessage `json:"action,omitempty"`   // TODO: estructurar de alguna forma?
	NoSignal    json.RawMessage `json:"nosignal,omitempty"` // TODO: estructurar de alguna forma?
	RuleStatus
}

func (Rule) ActionList added in v0.3.7

func (rule Rule) ActionList() []interface{}

ActionList converts the action field into list of actions

func (Rule) MarshalJSON added in v0.1.8

func (x Rule) MarshalJSON() ([]byte, error)

func (Rule) Serialize added in v0.1.5

func (x Rule) Serialize(s serialize.Serializer)

type RuleStatus

type RuleStatus struct {
	Subservice string `json:"subservice,omitempty"`
	Service    string `json:"service,omitempty"`
	ID         string `json:"_id,omitempty"`
}

RuleStatus agrupa atributos de estado que no se usan al crear una Rule

func (RuleStatus) MarshalJSON added in v0.1.8

func (x RuleStatus) MarshalJSON() ([]byte, error)

func (RuleStatus) Serialize added in v0.1.5

func (x RuleStatus) Serialize(s serialize.Serializer)

type Service

type Service struct {
	Resource           string            `json:"resource"`
	APIKey             string            `json:"apikey"`
	EntityType         string            `json:"entity_type"`
	Description        string            `json:"description,omitempty"`
	Protocol           string            `json:"protocol"`
	Transport          string            `json:"transport,omitempty"`
	Timestamp          bool              `json:"timestamp,omitempty"`
	ExplicitAttrs      json.RawMessage   `json:"explicitAttrs,omitempty"`
	InternalAttributes []DeviceAttribute `json:"internal_attributes,omitempty"`
	Attributes         []DeviceAttribute `json:"attributes"`
	Lazy               []DeviceAttribute `json:"lazy,omitempty"`
	StaticAttributes   []DeviceAttribute `json:"static_attributes,omitempty"`
	Commands           []DeviceCommand   `json:"commands,omitempty"`
	ExpressionLanguage string            `json:"expressionLanguage,omitempty"`
	EntityNameExp      string            `json:"entityNameExp,omitempty"`
	GroupStatus
}

Service describe la provisión de un grupo de dispositivos

func (Service) MarshalJSON added in v0.1.8

func (x Service) MarshalJSON() ([]byte, error)

func (Service) Serialize added in v0.1.5

func (x Service) Serialize(s serialize.Serializer)

type ServiceMapping

type ServiceMapping struct {
	OriginalService     string               `json:"originalService,omitempty"`
	NewService          string               `json:"newService,omitempty"`
	ServicePathMappings []ServicePathMapping `json:"servicePathMappings"`
}

ServiceMapping es cada uno de los serviceMappings de cygnus

func (ServiceMapping) MarshalJSON added in v0.1.8

func (x ServiceMapping) MarshalJSON() ([]byte, error)

func (ServiceMapping) Serialize added in v0.1.5

func (x ServiceMapping) Serialize(s serialize.Serializer)

type ServicePathMapping

type ServicePathMapping struct {
	OriginalServicePath string          `json:"originalServicePath,omitempty"`
	NewServicePath      string          `json:"newServicePath,omitempty"`
	EntityMappings      []EntityMapping `json:"entityMappings"`
}

ServicePathMapping es cada uno de los servicePathMappings de un serviceMapping

func (ServicePathMapping) MarshalJSON added in v0.1.8

func (x ServicePathMapping) MarshalJSON() ([]byte, error)

func (ServicePathMapping) Serialize added in v0.1.5

func (x ServicePathMapping) Serialize(s serialize.Serializer)

type Subject

type Subject struct {
	Condition SubjectCondition `json:"condition"`
	Entities  []SubjectEntity  `json:"entities" compact:"true"`
}

Subject es el sujeto de la suscripcion

func (Subject) MarshalJSON added in v0.1.8

func (x Subject) MarshalJSON() ([]byte, error)

func (Subject) Serialize added in v0.1.5

func (x Subject) Serialize(s serialize.Serializer)

type SubjectCondition

type SubjectCondition struct {
	Attrs           []string          `json:"attrs" sort:"true"`
	Expression      SubjectExpression `json:"expression,omitempty"`
	AlterationTypes []string          `json:"alterationTypes,omitempty"`
}

SubjectCondition es la condicion del sujeto de la suscripcion

func (SubjectCondition) MarshalJSON added in v0.1.8

func (x SubjectCondition) MarshalJSON() ([]byte, error)

func (SubjectCondition) Serialize added in v0.1.5

func (x SubjectCondition) Serialize(s serialize.Serializer)

type SubjectEntity

type SubjectEntity struct {
	ID        string `json:"id,omitempty"`
	IdPattern string `json:"idPattern,omitempty"`
	Type      string `json:"type"`
}

SubjectEntity es la entidad sujeto de la suscripcion

func (SubjectEntity) MarshalJSON added in v0.1.8

func (x SubjectEntity) MarshalJSON() ([]byte, error)

func (SubjectEntity) Serialize added in v0.1.5

func (x SubjectEntity) Serialize(s serialize.Serializer)

type SubjectExpression

type SubjectExpression struct {
	Q string `json:"q,omitempty"`
}

SubjectExpression es la expresion en la condicion

func (SubjectExpression) IsEmpty added in v0.1.5

func (s SubjectExpression) IsEmpty() bool

func (SubjectExpression) MarshalJSON added in v0.1.8

func (x SubjectExpression) MarshalJSON() ([]byte, error)

func (SubjectExpression) Serialize added in v0.1.5

func (x SubjectExpression) Serialize(s serialize.Serializer)

type Subscription added in v0.3.7

type Subscription struct {
	Description  string       `json:"description"`
	Status       string       `json:"status,omitempty"`
	Expires      string       `json:"expires,omitempty"`
	Notification Notification `json:"notification"`
	Subject      Subject      `json:"subject"`
	SubscriptionStatus
}

Subscription representa una suscripcion

func (Subscription) MarshalJSON added in v0.3.7

func (x Subscription) MarshalJSON() ([]byte, error)

func (Subscription) Serialize added in v0.3.7

func (x Subscription) Serialize(s serialize.Serializer)

func (Subscription) UpdateEndpoint added in v0.3.7

func (subs Subscription) UpdateEndpoint(notificationEndpoints map[string]string) (Subscription, error)

UpdateEndpoint updates the notification endpoint

type SubscriptionStatus added in v0.3.7

type SubscriptionStatus struct {
	ID string `json:"id,omitempty"`
}

SubscriptionStatus agrupa los datos de estado de la suscripción

func (SubscriptionStatus) MarshalJSON added in v0.3.7

func (x SubscriptionStatus) MarshalJSON() ([]byte, error)

func (SubscriptionStatus) Serialize added in v0.3.7

func (x SubscriptionStatus) Serialize(s serialize.Serializer)

type Table

type Table struct {
	Name       string        `json:"name"`
	Columns    []TableColumn `json:"columns"`
	PrimaryKey []string      `json:"primaryKey"`
	Indexes    []TableIndex  `json:"indexes"`
	LastData   bool          `json:"lastdata"`            // True si queremos crear una vista lastdata adicional
	Singleton  []string      `json:"singleton,omitempty"` // Lista de campos únicos, si la entidad es un singleton.
}

Table define algunos parámetros básicos de tablas a crear

func (Table) MarshalJSON added in v0.1.8

func (x Table) MarshalJSON() ([]byte, error)

func (Table) Serialize added in v0.1.5

func (x Table) Serialize(s serialize.Serializer)

type TableColumn

type TableColumn struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	NotNull bool   `json:"notNull,omitempty"`
	Default string `json:"default,omitempty"`
}

TableColumn describe una columna de una tabla

func (TableColumn) MarshalJSON added in v0.1.8

func (x TableColumn) MarshalJSON() ([]byte, error)

func (TableColumn) Serialize added in v0.1.5

func (x TableColumn) Serialize(s serialize.Serializer)

type TableIndex

type TableIndex struct {
	Name     string   `json:"name"`
	Columns  []string `json:"columns"`
	Geometry bool     `json:"geometry,omitempty"`
}

TableIndex describe un indice

func (TableIndex) MarshalJSON added in v0.1.8

func (x TableIndex) MarshalJSON() ([]byte, error)

func (TableIndex) Serialize added in v0.1.5

func (x TableIndex) Serialize(s serialize.Serializer)

type UrboPanel added in v0.2.9

type UrboPanel struct {
	Name          string `json:"name"`
	Description   string `json:"description,omitempty"`
	Slug          string `json:"slug"`
	LowercaseSlug string `json:"lowercaseSlug,omitempty"`
	WidgetCount   int    `json:"widgetCount,omitempty"`
	IsShadow      bool   `json:"isShadow,omitempty"`
	Section       string `json:"section,omitempty"`
}

UrboPanel representa un panel de Urbo

func (UrboPanel) MarshalJSON added in v0.2.9

func (x UrboPanel) MarshalJSON() ([]byte, error)

func (UrboPanel) Serialize added in v0.2.9

func (x UrboPanel) Serialize(s serialize.Serializer)

type UrboVerticalStatus added in v0.3.7

type UrboVerticalStatus struct {
	PanelsObjects       []UrboPanel `json:"panelsObjects,omitempty"`
	ShadowPanelsObjects []UrboPanel `json:"shadowPanelsObjects,omitempty"`
}

UrboVerticalStatus contains detailed vertical status

func (UrboVerticalStatus) MarshalJSON added in v0.3.7

func (x UrboVerticalStatus) MarshalJSON() ([]byte, error)

func (UrboVerticalStatus) Serialize added in v0.3.7

func (x UrboVerticalStatus) Serialize(s serialize.Serializer)

type Vertical

type Vertical struct {
	Panels       []string        `json:"panels,omitempty" compact:"true"`
	ShadowPanels []string        `json:"shadowPanels,omitempty" compact:"true"`
	Slug         string          `json:"slug"`
	Name         string          `json:"name"`
	Icon         string          `json:"icon,omitempty"`
	I18n         json.RawMessage `json:"i18n,omitempty"`
	UrboVerticalStatus
}

Vertical representa una vertical de Urbo

func (Vertical) AllPanels added in v0.4.4

func (v Vertical) AllPanels() []string

Return all Panels of the vertical, regular and shadow

func (Vertical) MarshalJSON added in v0.1.8

func (x Vertical) MarshalJSON() ([]byte, error)

func (Vertical) Serialize added in v0.1.5

func (x Vertical) Serialize(s serialize.Serializer)

type View added in v0.2.9

type View struct {
	Materialized bool         `json:"materialized,omitempty"`
	Name         string       `json:"name"`
	From         string       `json:"from"`
	Group        []string     `json:"group"`
	Columns      []ViewColumn `json:"columns"`
}

MaterializedView define los parámetros de las vistas materializadas

func (View) MarshalJSON added in v0.2.9

func (x View) MarshalJSON() ([]byte, error)

func (View) Serialize added in v0.2.9

func (x View) Serialize(s serialize.Serializer)

type ViewColumn added in v0.2.9

type ViewColumn struct {
	Name       string `json:"name"`
	Expression string `json:"expression"`
}

ViewColumn define las columnas de la vista

func (ViewColumn) MarshalJSON added in v0.2.9

func (x ViewColumn) MarshalJSON() ([]byte, error)

func (ViewColumn) Serialize added in v0.2.9

func (x ViewColumn) Serialize(s serialize.Serializer)

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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