Слияние кода завершено, страница обновится автоматически
/*******************************************************************************
* Copyright 2017 Dell Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*
* @microservice: core-metadata-go service
* @author: Spencer Bull & Ryan Comer, Dell
* @version: 0.5.0
*******************************************************************************/
package main
import (
"errors"
"github.com/edgexfoundry/core-domain-go/enums"
)
// Struct used to pase the JSON configuration file
type ConfigurationStruct struct {
ApplicationName string
DBType string
MongoDatabaseName string
MongoDBUserName string
MongoDBPassword string
MongoDBHost string
MongoDBPort int
MongoDBConnectTimeout int
ReadMaxLimit int
Protocol string
ServiceName string
ServiceAddress string
ServerPort int
ServerTimeout int
HeartBeatTime int
HeartBeatMsg string
AppOpenMsg string
CheckInterval string
ConsulProfilesActive string
ConsulHost string
ConsulCheckAddress string
ConsulPort int
LoggingFile string
LoggingRemoteURL string
NotificationPostDeviceChanges bool
NotificationsSlug string
NotificationContent string
NotificationSender string
NotificationDescription string
NotificationLabel string
SupportNotificationsNotificationURL string
SupportNotificationsSubscriptionURL string
SupportNotificationsTransmissionURL string
}
// Configuration data for the metadata service
var configuration ConfigurationStruct = ConfigurationStruct{} // Needs to be initialized before used
var (
/* -------------- CONFIG for METADATA -------------------- */
DATABASE enums.DATABASE
DBTYPE = "mongodb"
PROTOCOL = "http"
SERVERPORT = "48081"
DOCKERMONGO = "edgex-mongo:27017"
DBUSER = "meta"
DBPASS = "password"
MONGODATABASE = "metadata"
CONFIG = "res/configuration.json"
METADATASERVICENAME = "core-metadata"
MAX_LIMIT int = 1000
/* ----------------------- CONSTANTS ----------------------------*/
REST = "http"
GET = "GET"
PUT = "PUT"
POST = "POST"
DELETE = "DELETE"
MONGOSTR = "mongo"
DB = "metadata"
DEVICECOL = "device"
DPCOL = "deviceProfile"
DSCOL = "deviceService"
ADDCOL = "addressable"
COMCOL = "command"
DRCOL = "deviceReport"
SECOL = "scheduleEvent"
SCOL = "schedule"
PWCOL = "provisionWatcher"
TIMELAYOUT = "20060102T150405"
/* ---------------- URL PARAM NAMES -----------------------*/
ID = "id"
_ID = "_id"
NAME = "name"
OPSTATE = "opstate"
URLADMINSTATE = "adminstate"
ADMINSTATE = "adminState"
URLLASTREPORTED = "lastreported"
LASTREPORTED = "lastReported"
LASTREPORTEDNOTIFY = "lastreportednotify"
URLLASTCONNECTED = "lastconnected"
LASTCONNECTED = "lastConnected"
LASTCONNECTEDNOTIFY = "lastconnectednotify"
ADDRESSABLE = "addressable"
ADDRESSABLENAME = "addressablename"
ADDRESSABLEID = "addressableid"
SERVICE = "service"
SERVICENAME = "servicename"
SERVICEID = "serviceid"
LABEL = "label"
LABELS = "labels"
PROFILE = "profile"
PROFILEID = "profileid"
PROFILENAME = "profilename"
DEVICEPROFILE = "deviceprofile"
UPLOADFILE = "uploadfile"
UPLOAD = "upload"
MODEL = "model"
MANUFACTURER = "manufacturer"
YAML = "yaml"
DEVICEREPORT = "devicereport"
DEVICENAME = "devicename"
DEVICESERVICE = "deviceservice"
SCHEDULEEVENT = "scheduleevent"
SCHEDULE = "schedule"
TOPIC = "topic"
PORT = "port"
PUBLISHER = "publisher"
ADDRESS = "address"
COMMAND = "command"
DEVICE = "device"
OPERATINGSTATE = "operatingState"
PROVISIONWATCHER = "provisionwatcher"
IDENTIFIER = "identifier"
IDENTIFIERS = "identifiers"
KEY = "key"
VALUE = "value"
VALUEDESCRIPTORSFOR = "valueDescriptorsFor"
DEVICEADDRESSABLES = "deviceaddressables"
DEVICEADDRESSABLESBYNAME = "deviceaddressablesbyname"
/* ----------------------- ERRORS ----------------------------*/
ErrNotFound = errors.New("Not found")
ErrDuplicateName = errors.New("Duplicate name for the resource")
ErrDuplicateCommandInProfile = errors.New("Duplicate name for command in device profile")
ErrCommandStillInUse = errors.New("Command is still in use by device profiles")
/* TODO ENUM */
LOCKED = "LOCKED"
UNLOCKED = "UNLOCKED"
ENABLED = "ENABLED"
DISABLED = "DISABLED"
QUERYTS = "-timestamp"
)
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )