common

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 19 Imported by: 66

Documentation

Index

Constants

View Source
const (
	// status at sender side
	NotReadyToSend     = "notReady"           // The object is not ready to be sent to the other side
	Verifying          = "verifying"          // The object data is in the process of verification
	VerificationFailed = "verificationFailed" // The data verification is failed
	ReadyToSend        = "ready"              // The object is ready to be sent to the other side
	// status at receiver side
	PartiallyReceived          = "partiallyreceived"          // Received the object from the other side, waiting for its data
	ReceiverVerifying          = "receiverVerifying"          // The object data at receiver side is in the process of verification
	ReceiverVerificationFailed = "receiverVerificationFailed" // The data verification is failed at receiver side
	CompletelyReceived         = "completelyReceived"         // The object was received completely from the other side
	ObjConsumed                = "objconsumed"                // The object was consumed by the app
	ObjDeleted                 = "objdeleted"                 // The object was deleted by the other side
	ObjReceived                = "objreceived"                // The object was received by the app
	ConsumedByDest             = "consumedByDest"             // The object was consumed by the other side (ESS only)
)

Object status

View Source
const (
	Update                = "update"
	Updated               = "updated"
	HandleUpdate          = "handleUpdate"
	Consumed              = "consumed"
	AckConsumed           = "ackconsumed"
	ConsumedByDestination = "consumedByDest"
	Getdata               = "getdata"
	Data                  = "data"
	UpdatePending         = "updatePending"
	ConsumedPending       = "consumedPending"
	Delete                = "delete"
	DeletePending         = "deletePending"
	Deleted               = "deleted"
	DeletedPending        = "deletedPending"
	AckDelete             = "ackDelete"
	AckDeleted            = "ackDeleted"
	Resend                = "resend"
	AckResend             = "ackresend"
	Register              = "register"
	AckRegister           = "regack"
	RegisterNew           = "registerNew"
	RegisterAsNew         = "registerAsNew"
	Unregister            = "unregister"
	Received              = "received"
	ReceivedPending       = "receivedpending"
	AckReceived           = "ackreceived"
	ReceivedByDestination = "receivedByDest"
	Feedback              = "feedback"
	Error                 = "error"
	Ping                  = "ping"
	ReceiverError         = "receiverError"
)

Notification status and type

View Source
const (
	Pending    = "pending"
	Delivering = "delivering"
	Delivered  = "delivered"
)

Indication whether the object has been delivered to the destination

View Source
const (
	InternalErrorCode = 1
	IOErrorCode       = 2
	SecurityErrorCode = 3
	PathErrorCode     = 4
	InvalidObject     = 5
)

Feedback codes

View Source
const (
	DestinationsACLType = "destinations"
	ObjectsACLType      = "objects"
)

Types of various ACLs

View Source
const (
	AddAction      = "add"
	RemoveAction   = "remove"
	RegisterAction = "register"
	DeleteAction   = "delete"
)

API payload actions

View Source
const (
	TypeDestination = "destination"
	TypeObject      = "object"
)

NotificationType of object sent to objectWorkQueue

View Source
const (
	ResendAll = iota
	ResendDelivered
	ResendUndelivered
)

Resend flag options

View Source
const (
	Bolt     = "bolt"
	InMemory = "inmemory"
	Mongo    = "mongo"
)

Storage providers

View Source
const (
	Sha1   = "SHA1"
	Sha256 = "SHA256"
)

Hash Algorithms supported for digital signature

View Source
const (
	CSS = "CSS"
	ESS = "ESS"
)

Cloud Sync Service or Edge Sync Service

View Source
const (
	ListeningBoth       = "both"
	ListeningSecurely   = "secure"
	ListeningUnsecurely = "unsecure"
	ListeningUnix       = "unix"
	ListeningSecureUnix = "secure-unix"
)

Listening types

View Source
const (
	MQTTProtocol = "mqtt"
	HTTPProtocol = "http"
	HybridMQTT   = "hybrid-mqtt"
	HybridWIoTP  = "hybrid-wiotp"
	WIoTP        = "wiotp"
)

Protocol definitions

View Source
const (
	ParallelMQTTNone   = "none"
	ParallelMQTTSmall  = "small"
	ParallelMQTTMedium = "medium"
	ParallelMQTTLarge  = "large"
)

The parallelism modes by which incoming MQTT messages are processed

View Source
const (
	Red    = "red"
	Yellow = "yellow"
	Green  = "green"
)

Health status values

View Source
const DefaultLogTraceFileSize = 20000

DefaultLogTraceFileSize default value for log and trace file size in KB

View Source
const MANIFEST_OBJECT_TYPE = "agent_upgrade_manifests"
View Source
const Magic = uint32(0x01010101)

Magic is a magic number placed in the front of various payloads

Variables

View Source
var HTTPCSSURL string

HTTPCSSURL specifies the CSS URL for HTTP communication from ESS

View Source
var IsInvalidDescription = regexp.MustCompile(`<[/]?[a-zA-Z0-9]+>`).MatchString

IsInvalidDescription checks if metadata description text contains XSS tags in this format: <abc> or </abc>

View Source
var IsValidName = regexp.MustCompile(`^[a-zA-Z0-9|!|@|#|$|^|*|\-|_|.|~|\pL|\pN]+$`).MatchString

IsValidName checks if the string only contains letters, digits, and !@#%^*-_.~

View Source
var ObjectDownloadSemaphore *semaphore.Weighted

ObjectDownloadSemaphore sets the concurrent spi object download concurrency

View Source
var Registered bool

Registered indicates if this node, an ESS, has registered itself

View Source
var ResendAcked bool

ResendAcked indicates if the resend objects request had been acknowledged

View Source
var Running bool

Running indicates that the Sync Service is running

View Source
var ServingAPIs bool

ServingAPIs when true, indicates that the Sync Service is serving the various APIs over HTTP

View Source
var SingleOrgCSS bool

SingleOrgCSS is true in case of CSS ouside WIoTP with one organization set in the configration, and false otherwise

Functions

func BlockUntilNoRunningGoRoutines

func BlockUntilNoRunningGoRoutines()

BlockUntilNoRunningGoRoutines blocks the current "thread"

func CreateFeedback

func CreateFeedback(err SyncServiceError) (code int, retryInterval int32, reason string)

CreateFeedback extracts feedback parameters from an error

func CreateNotificationID

func CreateNotificationID(orgID string, objectType string, objectID string, destType string, destID string) string

CreateNotificationID creates notification ID

func GetNotificationID

func GetNotificationID(notification Notification) string

GetNotificationID gets the notification ID for the notification

func GoRoutineEnded

func GoRoutineEnded()

GoRoutineEnded decrements the go routines counter

func GoRoutineStarted

func GoRoutineStarted()

GoRoutineStarted increments the go routines counter

func HashStrings

func HashStrings(strings ...string) uint32

HashStrings hashes strings

func InitObjectDownloadSemaphore added in v1.6.8

func InitObjectDownloadSemaphore()

InitObjectDownloadSemaphore initializes ObjectDownloadSemaphore

func InitObjectLocks

func InitObjectLocks()

InitObjectLocks initializes ObjectLocks

func IsErrorFeedback

func IsErrorFeedback(code int) bool

IsErrorFeedback returns true if the feedback code corresponds to an error

func IsIgnoredRequest added in v1.6.8

func IsIgnoredRequest(err error) bool

IsInvalidRequest returns true if the error passed in is the common.InvalidRequest error

func IsInvalidRequest

func IsInvalidRequest(err error) bool

IsInvalidRequest returns true if the error passed in is the common.InvalidRequest error

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error passed in is the common.NotFound error

func IsTooManyRequestError added in v1.9.5

func IsTooManyRequestError(err error) bool

func IsValidHashAlgorithm added in v1.6.4

func IsValidHashAlgorithm(hashAlgorithm string) bool

func Load

func Load(configFileName string) error

Load loads the configuration from the specified properties file

func NeedDataVerification added in v1.6.8

func NeedDataVerification(metaData MetaData) bool

func ResetGoRoutineCounter

func ResetGoRoutineCounter()

ResetGoRoutineCounter sets the go routines counter to 0

func ServiceListContains

func ServiceListContains(serviceList []ServiceID, service ServiceID) bool

ServiceListContains returns true if serviceIDList contains the given serviceID

func SetDefaultConfig

func SetDefaultConfig(config *Config)

SetDefaultConfig sets the default configuration into the provided Config struct

func StringListContains added in v0.10.12

func StringListContains(stringList []string, str string) bool

StringListContains returns true if string list contains given string

func StringListEqual added in v1.8.4

func StringListEqual(sList1 []string, sList2 []string) bool

StringListEqual returns true if sList1 and sList2 contain same strings

func ValidateConfig

func ValidateConfig() error

ValidateConfig Validates the configuration

func VersionAsString

func VersionAsString() string

VersionAsString returns the current version as string

Types

type ACLentry added in v0.10.12

type ACLentry struct {
	Username    string
	ACLUserType string
	ACLRole     string
}

ACLentry contains ACL information about each user

type ChunkInfo

type ChunkInfo struct {
	ResendTime int64 `json:"resendTime" bson:"resend-time"`
}

ChunkInfo describes chunks for multi-inflight data transfer. swagger:ignore

type Config

type Config struct {
	// NodeType specifies whether this node is a CSS or ESS
	NodeType string `env:"NODE_TYPE"`

	// DestinationType specifies the destination type of this node
	DestinationType string `env:"DESTINATION_TYPE"`

	// DestinationID specifies the destination id of this node
	DestinationID string `config:"DestinationId" env:"DESTINATION_ID"`

	// OrgID specifies the organization ID of this node
	OrgID string `config:"OrgId" env:"ORG_ID"`

	// ListeningType specifies whether or the server is
	// listening securely, unsecurely, both securely and unsecurely, using Unix sockets,
	// or using Unix sockets securely.
	// Possible values are secure, unsecure, both, unix, secure-unix.
	// unix and secure-unix can only be specified if the NodeType is ESS.
	// Defaults to unsecure on a CSS and secure on an ESS
	ListeningType string `env:"LISTENING_TYPE"`

	// ListeningAddress specifies the address to listen on
	// If the ListeningType is unix or secure-unix, this property specifies the socket file to be used.
	// The file will be erased and recreated, if it already exists. The filename is relative
	// to the PersistenceRootPath configuration property if it doesn't start with a slash (/).
	ListeningAddress string `env:"LISTENING_ADDRESS"`

	// SecureListeningPort specifies the port to listen on for HTTPS
	SecureListeningPort uint16 `env:"SECURE_LISTENING_PORT"`

	// UnsecureListeningPort specifies the port the CSS listens on for HTTP
	UnsecureListeningPort uint16 `env:"UNSECURE_LISTENING_PORT"`

	// ServerCertificate specifies the Server side certificate to use to serve as HTTPS.
	// This value can either be the certificate itself or the path of a file containing
	// the certificate. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	ServerCertificate string `env:"SERVER_CERTIFICATE"`

	// ServerKey specifies the Server side key to use to serve as HTTPS.
	// This value can either be the key itself or the path of a file containing the key.
	// If it is a path of a file, then it is relative to the PersistenceRootPath configuration
	// property if it doesn't start with a slash (/).
	ServerKey string `env:"SERVER_KEY"`

	// CSSOnWIoTP indicates whether the CSS is inside or outside the WIoTP.
	// The default value is false, i.e. outside.
	CSSOnWIoTP bool `env:"CSS_ON_WIOTP"`

	// UsingEdgeConnector indicates whether or not the ESS should connect to the Watson IoT Platform via an Edge Connector.
	// Not relevant to the CSS.
	// The default value is false.
	UsingEdgeConnector bool `env:"USING_EDGE_CONNECTOR"`

	// LeadershipTimeout is the timeout for leadership updates in seconds
	LeadershipTimeout int32 `env:"LEADERSHIP_TIMEOUT"`

	// AuthenticationHandler indicates which Authentication handler should be used.
	// The current possible values are:
	//     dummy - for the dummyAuthenticate Authentication handler
	AuthenticationHandler string `env:"AUTHENTICATION_HANDLER"`

	// Buffer size of Object Queue to send objects for notification handling
	//  For the CSS, default value is 1000
	//  For the ESS, default value is 2
	ObjectQueueBufferSize uint64 `env:"OBJECT_QUEUE_BUFFER_SIZE"`

	// Buffer size of Object Queue to verify object data
	//  Default size is 500
	VerifyQueueBufferSize uint64 `env:"VERIFY_QUEUE_BUFFER_SIZE"`

	// CommunicationProtocol is a comma separated list of protocols to be used for communication between CSS and ESS
	//  The elements of the list can be 'http', 'mqtt', and 'wiotp'
	//  wiotp indicates MQTT communication via the Watson IoT Platform and mqtt indicates direct MQTT communication to a broker
	//  The list must not include both wiotp and mqtt (only one mode of MQTT communication is allowed)
	//  For ESS only a single protocol is allowed
	//  The default is mqtt
	CommunicationProtocol string `env:"COMMUNICATION_PROTOCOL"`

	// MQTTClientID contains the client id
	MQTTClientID string `config:"MQTTClientId" env:"MQTT_CLIENT_ID"`

	// MQTTUserName contains the MQTT user name
	MQTTUserName string `env:"MQTT_USER_NAME"`

	// MQTTPassword contains the MQTT password
	MQTTPassword string `env:"MQTT_PASSWORD"`

	// MQTTUseSSL specifies whether or not to use SSL connection with  the broker
	MQTTUseSSL bool `env:"MQTT_USE_SSL"`

	// MQTTCACertificate specifies the CA certificate that was used to sign the server certificates
	// used by the MQTT broker. This value can either be the CA certificate itself or the path of a file
	// containing the CA certificate. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	// Default value: broker/ca/ca.cert.pem
	MQTTCACertificate string `env:"MQTT_CA_CERTIFICATE"`

	// MQTTSSLCert specifies the SSL client certificate of the X509 key pair used to communicate with
	// the MQTT broker. This value can either be the certificate itself or the path of a file containing
	// the certificate. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	MQTTSSLCert string `env:"MQTT_SSL_CERT"`

	// MQTTSSLKey specifies the SSL client key of the X509 key pair used to communicate with the
	// MQTT broker. This value can either be the key itself or the path of a file containing the
	// key. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	MQTTSSLKey string `env:"MQTT_SSL_KEY"`

	// MQTTAllowInvalidCertificates specifies that the MQTT client will not attempt to validate the server certificates
	// Please only set this for development purposes! It makes using TLS pointless and is never the right answer.
	// Defaults to false
	MQTTAllowInvalidCertificates bool `env:"MQTT_ALLOW_INVALID_CERTIFICATES"`

	// MQTTBrokerConnectTimeout specifies the timeout (in seconds) of attempts to connect to the MQTT broker on startup
	// Default value 300
	MQTTBrokerConnectTimeout int `env:"MQTT_BROKER_CONNECT_TIMEOUT"`

	// MQTTParallelMode specifies the parallelism mode by which incoming MQTT messages are processed
	// Possible values: "none", "small", "medium", "large"
	// Default is "none" (or empty string), i.e., no threading
	MQTTParallelMode string `env:"PARALLEL_MQTT_MODE"`

	// Root path for storing persisted data.
	//  Default value: /var/wiotp-edge/persist
	PersistenceRootPath string `env:"PERSISTENCE_ROOT_PATH"`

	// BrokerAddress specifies the address to connect to for the MQTT broker or
	// a list of server URIs for environments with multiple MQTT brokers
	BrokerAddress string `env:"BROKER_ADDRESS"`

	// BrokerPort specifies the port to connect to for the MQTT broker
	BrokerPort uint16 `env:"BROKER_PORT"`

	// HTTPPollingInterval specifies the frequency in seconds of ESS HTTP polling for updates
	HTTPPollingInterval uint16 `env:"HTTP_POLLING_INTERVAL"`

	// HTTPCSSHost specifies the CSS host for HTTP communication from ESS
	HTTPCSSHost string `env:"HTTP_CSS_HOST"`

	// HTTPCSSPort specifies the CSS host for HTTP communication from ESS
	HTTPCSSPort uint16 `env:"HTTP_CSS_PORT"`

	// HTTPCSSUseSSL specifies whether or not to use SSL connection with the CSS
	HTTPCSSUseSSL bool `env:"HTTP_CSS_USE_SSL"`

	// HTTPCSSCACertificate specifies the CA certificate that was used to sign the server certificate
	// used by the CSS. This value can either be the CA certificate itself or the path of a file containing
	// the CA certificate. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	// Default value: none
	HTTPCSSCACertificate string `env:"HTTP_CSS_CA_CERTIFICATE"`

	// HTTPESSClientTimeout is to specify the http client timeout in seconds for ESS
	// default is 120s
	HTTPESSClientTimeout int `env:"HTTPESSClientTimeout"`

	// HTTPESSObjClientTimeout is to specify the http client timeout for downloading models (or objects) in seconds for ESS
	// default is 600s
	HTTPESSObjClientTimeout int `env:"HTTPESSObjClientTimeout"`

	// HTTPCSSObjDownloadConcurrencyMultiplier specifies a number to multiple the number of threads by to set allowed concurrent downloads per CSS
	// default is 1
	HTTPCSSObjDownloadConcurrencyMultiplier int `env:"HTTPCSSObjDownloadConcurrencyMultiplier"`

	// HTTPServerReadHeaderTimeout is to specifyt the http server ReadHeaderTimout in second
	// default is 60
	HTTPServerReadHeaderTimeout int `env:"HTTPServerReadHeaderTimeout"`

	// LogLevel specifies the logging level in string format
	LogLevel string `env:"LOG_LEVEL"`

	// LogRootPath specifies the root path for the log files
	LogRootPath string `env:"LOG_ROOT_PATH"`

	// LogTraceDestination is a comma separated list of destinations for the logging and tracing
	// The elements of the list can be `file`, `stdout`, `syslog`, and 'glog'
	// 'glog' is golang/glog logger
	LogTraceDestination string `env:"LOG_TRACE_DESTINATION"`

	// LogFileName specifies the name of the log file
	LogFileName string `env:"LOG_FILE_NAME"`

	// TraceLevel specifies the tracing level in string form
	TraceLevel string `env:"TRACE_LEVEL"`

	// TraceRootPath specifies the root path for the trace files
	TraceRootPath string `env:"TRACE_ROOT_PATH"`

	// TraceFileName specifies the name of the trace file
	TraceFileName string `env:"TRACE_FILE_NAME"`

	// Maximal size of a trace/log file in kilo bytes.
	LogTraceFileSizeKB int `env:"LOG_TRACE_FILE_SIZE_KB"`

	// The limit on the number of compressed files of trace/log.
	MaxCompressedlLogTraceFilesNumber int `env:"MAX_COMPRESSED_LOG_TRACE_FILES_NUMBER"`

	// LogTraceMaintenanceInterval specifies the frequency in seconds of log and trace maintenance (memory consumption, etc.)
	LogTraceMaintenanceInterval int16 `env:"LOG_TRACE_MAINTENANCE_INTERVAL"`

	// ResendInterval specifies the frequency in seconds of checks to resend unacknowledged notifications
	// ESS resends register notification with this interval
	// Other notifications are resent with frequency equal to ResendInterval*6
	ResendInterval int16 `env:"RESEND_INTERVAL"`

	// ESSCallSPIRetryInterval specifies the frequence in seconds of resend failed updated notifications.
	// Default is 2s
	ESSCallSPIRetryInterval int32 `env:"ESS_CALL_SPI_RETRY_INTERVAL"`

	// ESSSPIMaxRetry specifies the number of retry if ESS receives notification transparent error
	ESSSPIMaxRetry int `env:"ESSSPIMaxRetry"`

	// ESSPingInterval specifies the frequency in hours of ping messages that ESS sends to CSS
	ESSPingInterval int16 `env:"ESS_PING_INTERVAL"`

	// RemoveESSRegistrationTime specifies the time period in days after which the CSS
	// removes an inactive ESS. Any pending records and operations for the ESS are removed.
	// CSS only parameter, ignored on ESS
	// A value of zero means ESSs are never removed
	RemoveESSRegistrationTime int16 `env:"REMOVE_ESS_REGISTRATION_TIME"`

	// EnableDataChunk specifies whether or not to transfer data in chunks between CSS and ESS
	// It is always true for MQTT
	EnableDataChunk bool `env:"ENABLE_DATA_CHUNK"`

	// Maximum size of data that can be sent in one message
	MaxDataChunkSize int `env:"MAX_DATA_CHUNK_SIZE"`

	// Max num of inflight chunks
	MaxInflightChunks int `env:"MAX_INFLIGHT_CHUNKS"`

	// MongoAddressCsv specifies one or more addresses of the mongo database
	MongoAddressCsv string `env:"MONGO_ADDRESS_CSV"`

	// MongoAuthDbName specifies the name of the database used to establish credentials and privileges
	MongoAuthDbName string `env:"MONGO_AUTH_DB_NAME"`

	// MongoDbName specifies the name of the database to use
	MongoDbName string `env:"MONGO_DB_NAME"`

	// MongoUsername specifies the username of the mongo database
	MongoUsername string `env:"MONGO_USERNAME"`

	// MongoPassword specifies the username of the mongo database
	MongoPassword string `env:"MONGO_PASSWORD"`

	// MongoUseSSL specifies whether or not to use SSL connection with mongo
	MongoUseSSL bool `env:"MONGO_USE_SSL"`

	// MongoCACertificate specifies the CA certificate that was used to sign the server certificate
	// used by the MongoDB server. This value can either be the CA certificate itself or the path of a
	// file containing the CA certificate. If it is a path of a file, then it is relative to the
	// PersistenceRootPath configuration property if it doesn't start with a slash (/).
	MongoCACertificate string `env:"MONGO_CA_CERTIFICATE"`

	// MongoAllowInvalidCertificates specifies that the mongo driver will not attempt to validate the server certificates.
	// Please only set this for development purposes! It makes using TLS pointless and is never the right answer.
	MongoAllowInvalidCertificates bool `env:"MONGO_ALLOW_INVALID_CERTIFICATES"`

	// MongoSessionCacheSize specifies the number of MongoDB session copies to use
	MongoSessionCacheSize int `env:"MONGO_SESSION_CACHE_SIZE"`

	// MongoSleepTimeBetweenRetry specifies the time in milliseconds between each retry of updating data in mongodb
	MongoSleepTimeBetweenRetry int `env:"MONGO_SLEEP_TIME_BETWEEN_RETRY"`

	// DatabaseConnectTimeout specifies that the timeout in seconds of database connection attempts on startup
	// The default value is 300
	DatabaseConnectTimeout int `env:"DATABASE_CONNECT_TIMEOUT"`

	// StorageMaintenanceInterval specifies the frequency in seconds of storage checks (for expired objects, etc.)
	StorageMaintenanceInterval int16 `env:"STORAGE_MAINTENANCE_INTERVAL"`

	// ObjectActivationInterval specifies the frequency in seconds of checking if there are inactive objects
	// that are ready to be activated
	ObjectActivationInterval int16 `env:"OBJECT_ACTIVATION_INTERVAL"`

	// StorageProvider specifies the type of the storage to be used by this node.
	// For the CSS the options are 'mongo' (the default), and 'bolt'
	// For the ESS the options are 'inmemory' (the default), and 'bolt'
	StorageProvider string `env:"STORAGE_PROVIDER"`

	// ESSConsumedObjectsKept specifies the number of objects sent by the ESS and consumed by the CSS
	// that are kept by the ESS for reporting
	// The default value is 1000
	ESSConsumedObjectsKept int `env:"ESS_CONSUMED_OBJECTS_KEPT"`

	// MessagingGroupCacheExpiration specifies the expiration time in minutes of organization to messaging group mapping cache
	MessagingGroupCacheExpiration int16 `env:"MESSAGING_GROUP_CACHE_EXPIRATION"`

	// ShutdownQuiesceTime specifies the maximum time in seconds that the Sync Service will wait for internal tasks to end while shuting down
	// The default values is 60 seconds
	ShutdownQuiesceTime int `env:"SHUTDOWN_QUIESCE_TIME"`

	// ObjectsDataPath specifies a directory in which the object's data should be persisted.
	// The application can then access the object's data directly on the file system instead of reading
	// the data via the Sync Service. Applications should only read/copy the data but not modify/delete it.
	// When ObjectsDataPath is set the DestinationDataURI field in the object's metadata includes
	// the full path to the object's data.
	// ObjectsDataPath can be used only when the StorageProvider is set to bolt.
	// The default is empty (not set) meaning that the object's data is persisted internally in a
	// path selected by the Sync Service.
	ObjectsDataPath string `env:"OBJECTS_DATA_PATH"`
}

Config contains the parsed contents of the configuration file

var Configuration Config

Configuration contains the read in configuration

type ConsumedObject

type ConsumedObject struct {
	MetaData  MetaData
	Timestamp time.Time
}

ConsumedObject contains consumed object's meta data and its timestamp

type DBHealthStatusInfo

type DBHealthStatusInfo struct {
	DBStatus           string `json:"dbStatus"`
	DisconnectedFromDB bool   `json:"disconnectedFromDB"`

	LastDisconnectFromDBDuration uint64 `json:"lastDisconnectFromDBDuration,omitempty"`
	DBReadFailures               uint32 `json:"dbReadFailures"`
	DBWriteFailures              uint32 `json:"dbWriteFailures"`

	TimeSinceLastReadWriteError uint64 `json:"timeSinceLastReadWriteError,omitempty"`
	// contains filtered or unexported fields
}

DBHealthStatusInfo describes the health status of the database of the sync-service node swagger:model

var DBHealth DBHealthStatusInfo

DBHealth describes the health status of the database of the sync-service node

type Destination

type Destination struct {

	// DestOrgID is the destination organization ID
	// Each sync service object belongs to a single organization
	DestOrgID string `json:"destinationOrgID" bson:"destination-org-id"`

	// DestType is the destination type
	//   required: true
	DestType string `json:"destinationType" bson:"destination-type"`

	// DestID is the destination ID
	//   required: true
	DestID string `json:"destinationID" bson:"destination-id"`

	// Communication is the communication protocol used by the destination to connect (can be MQTT or HTTP)
	//   required: true
	//   enum:  HTTP,MQTT
	Communication string `json:"communication" bson:"communication"`

	// CodeVersion is the sync service code version used by the destination
	//   required: true
	CodeVersion string `json:"codeVersion" bson:"code-version"`
}

Destination describes a sync service node. Each sync service edge node (ESS) has an address that is composed of the node's ID, Type, and Organization. An ESS node communicates with the CSS using either MQTT or HTTP. swagger:model

type DestinationRequestInQueue added in v1.6.7

type DestinationRequestInQueue struct {
	Action      string
	Status      string
	Object      MetaData
	Destination Destination
}

type DestinationsStatus

type DestinationsStatus struct {
	// DestType is the destination type
	//   required: true
	DestType string `json:"destinationType"`

	// DestID is the destination ID
	//   required: true
	DestID string `json:"destinationID"`

	// Status is the destination status
	//   required: true
	//   enum: pending,delivering,delivered,consumed,deleted,error
	Status string `json:"status"`

	// Message is the message for the destination
	//    required: false
	Message string `json:"message"`
}

DestinationsStatus describes the delivery status of an object for a destination DestinationsStatus provides information about the delivery status of an object for a certain destination. The status can be one of the following: Indication whether the object has been delivered to the destination

pending - inidicates that the object is pending delivery to this destination
delivering - indicates that the object is being delivered to this destination
delivered - indicates that the object was delivered to this destination
consumed - indicates that the object was consumed by this destination
deleted - indicates that this destination acknowledged the deletion of the object
error - indicates that a feedback error message was received from this destination

swagger:model

type HealthStatusInfo

type HealthStatusInfo struct {
	NodeType     string `json:"nodeType"`
	HealthStatus string `json:"healthStatus"`
	UpTime       uint64 `json:"upTime"`
	// contains filtered or unexported fields
}

HealthStatusInfo describes the health status of the sync-service node swagger:model

var HealthStatus HealthStatusInfo

HealthStatus describes the health status of the sync-service node

func (*HealthStatusInfo) ClientRequestReceived

func (hs *HealthStatusInfo) ClientRequestReceived()

ClientRequestReceived increments the client requests counter

func (*HealthStatusInfo) DBReadFailed

func (hs *HealthStatusInfo) DBReadFailed()

DBReadFailed increments the database read failures counter

func (*HealthStatusInfo) DBWriteFailed

func (hs *HealthStatusInfo) DBWriteFailed()

DBWriteFailed increments the database read failures counter

func (*HealthStatusInfo) DisconnectedFromBroker

func (hs *HealthStatusInfo) DisconnectedFromBroker()

DisconnectedFromBroker sets the DisconnectedFromMQTTBroker to true and the disconnectFromBrokerStartTime to current time

func (*HealthStatusInfo) DisconnectedFromDatabase

func (hs *HealthStatusInfo) DisconnectedFromDatabase()

DisconnectedFromDatabase sets the DisconnectedFromDB to true and the disconnectFromDBStartTime to current time

func (*HealthStatusInfo) GetLastDisconnectFromBrokerDuration

func (hs *HealthStatusInfo) GetLastDisconnectFromBrokerDuration() uint64

GetLastDisconnectFromBrokerDuration returns the duration of the last disconnect from the MQTT broker In case the node is currently disconnected, LastDisconnectFromBrokerDuration will be 0, and this function has to be called to calculated the duration of the current disconnect.

func (*HealthStatusInfo) GetLastDisconnectFromDBDuration

func (hs *HealthStatusInfo) GetLastDisconnectFromDBDuration() uint64

GetLastDisconnectFromDBDuration returns the duration of the last disconnect from the database In case the node is currently disconnected, LastDisconnectFromDBDuration will be 0, and this function has to be called to calculated the duration of the current disconnect.

func (*HealthStatusInfo) NodeStarted

func (hs *HealthStatusInfo) NodeStarted()

NodeStarted is called when the node starts

func (*HealthStatusInfo) PublishFailed

func (hs *HealthStatusInfo) PublishFailed()

PublishFailed increments the publish failures counter

func (*HealthStatusInfo) ReconnectedToBroker

func (hs *HealthStatusInfo) ReconnectedToBroker()

ReconnectedToBroker sets the DisconnectedFromMQTTBroker to false and calculates LastDisconnectFromBrokerDuration

func (*HealthStatusInfo) ReconnectedToDatabase

func (hs *HealthStatusInfo) ReconnectedToDatabase()

ReconnectedToDatabase sets the DisconnectedFromDB to false and the disconnectFromBrokerStartTime to current time

func (*HealthStatusInfo) SubscribeFailed

func (hs *HealthStatusInfo) SubscribeFailed()

SubscribeFailed increments the subscription failures counter

func (*HealthStatusInfo) UpdateHealthInfo

func (hs *HealthStatusInfo) UpdateHealthInfo(details bool, registeredESS uint32, storedObjects uint32)

UpdateHealthInfo updates the current health status of the sync service node

type IOError

type IOError struct {
	Message string
}

IOError is the error for requests failed because of the IO

func (*IOError) Error

func (e *IOError) Error() string

type IgnoredRequest added in v1.6.8

type IgnoredRequest struct {
	Message string
}

InvalidRequest is the error for invalid reguests swagger:ignore

func (*IgnoredRequest) Error added in v1.6.8

func (e *IgnoredRequest) Error() string

type InternalError

type InternalError struct {
	Message string
}

InternalError is a general error

func (*InternalError) Error

func (e *InternalError) Error() string

type InvalidRequest

type InvalidRequest struct {
	Message string
}

InvalidRequest is the error for invalid reguests swagger:ignore

func (*InvalidRequest) Error

func (e *InvalidRequest) Error() string

type Locks

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

Locks is a set of object locks

var ObjectLocks Locks

ObjectLocks are locks for object and notification changes

func NewLocks

func NewLocks(name string) *Locks

NewLocks initializes object locks

func (*Locks) ConditionalLock

func (locks *Locks) ConditionalLock(index uint32, lockedIndex uint32)

ConditionalLock locks the object if the index doesn't correspond to a lock that is already taken

func (*Locks) ConditionalUnlock

func (locks *Locks) ConditionalUnlock(index uint32, lockedIndex uint32)

ConditionalUnlock unlocks the object if the index doesn't correspond to a lock that is already taken

func (*Locks) Lock

func (locks *Locks) Lock(index uint32)

Lock locks the object

func (*Locks) RLock

func (locks *Locks) RLock(index uint32)

RLock locks the object for reading

func (*Locks) RUnlock

func (locks *Locks) RUnlock(index uint32)

RUnlock unlocks the object for reading

func (*Locks) Unlock

func (locks *Locks) Unlock(index uint32)

Unlock unlocks the object

type MQTTHealthStatusInfo

type MQTTHealthStatusInfo struct {
	MQTTConnectionStatus       string `json:"mqttConnectionStatus"`
	SubscribeFailures          uint32 `json:"subscribeFailures"`
	PublishFailures            uint32 `json:"publishFailures"`
	DisconnectedFromMQTTBroker bool   `json:"disconnectedFromMQTTBroker"`

	LastDisconnectFromBrokerDuration uint64 `json:"lastDisconnectFromBrokerDuration,omitempty"`

	TimeSinceLastSubscribeError uint64 `json:"timeSinceLastSubscribeError,omitempty"`

	TimeSinceLastPublishError uint64 `json:"timeSinceLastPublishError,omitempty"`
	// contains filtered or unexported fields
}

MQTTHealthStatusInfo describes the health status of the MQTT connection of the sync-service node swagger:model

var MQTTHealth MQTTHealthStatusInfo

MQTTHealth describes the health status of the MQTT connection of the sync-service node

type MessagingGroup

type MessagingGroup struct {
	OrgID     string
	GroupName string
}

MessagingGroup maps organization to its messaging group

type MetaData

type MetaData struct {
	// ObjectID is a unique identifier of the object
	//   required: true
	ObjectID string `json:"objectID" bson:"object-id"`

	// ObjectType is the type of the object.
	// The type is used to group multiple objects, for example when checking for object updates.
	//   required: true
	ObjectType string `json:"objectType" bson:"object-type"`

	// DestOrgID is the organization ID of the object (an object belongs to exactly one organization).
	// This field is ignored when working with ESS (the ESS's orgID is used).
	DestOrgID string `json:"destinationOrgID" bson:"destination-org-id"`

	// DestID is the ID of the destination. If omitted the object is sent to all ESSs with the same DestType.
	// This field is ignored when working with ESS (the destination is the CSS).
	DestID string `json:"destinationID" bson:"destination-id"`

	// DestType is the type of destination to send the object to.
	// If omitted (and if DestinationsList is omitted too) the object is broadcasted to all known destinations.
	// This field is ignored when working with ESS (the destination is always the CSS).
	DestType string `json:"destinationType" bson:"destination-type"`

	// DestinationsList is the list of destinations as type:id pairs to send the object to.
	// When a DestinationsList is provided DestType and DestID must be omitted.
	// This field is ignored when working with ESS (the destination is always the CSS).
	DestinationsList []string `json:"destinationsList" bson:"destinations-list"`

	// DestinationPolicy is the policy specification that should be used to distribute this object
	// to the appropriate set of destinations.
	// When a DestinationPolicy is provided DestinationsList, DestType, and DestID must be omitted.
	DestinationPolicy *Policy `json:"destinationPolicy" bson:"destination-policy"`

	// Expiration is a timestamp/date indicating when the object expires.
	// When the object expires it is automatically deleted.
	// The timestamp should be provided in RFC3339 format.
	// This field is available only when working with the CSS.
	// Optional field, if omitted the object doesn't expire.
	Expiration string `json:"expiration" bson:"expiration"`

	// Version is the object's version (as used by the application).
	// Optional field, empty by default.
	Version string `json:"version" bson:"version"`

	// Description is a textual description of the object.
	// Optional field, empty by default.
	Description string `json:"description" bson:"description"`

	// Link is a link to where the data for this object can be fetched from.
	// The link is set and used by the application. The sync service does not access the link.
	// Optional field, if omitted the data must be provided by the application.
	Link string `json:"link" bson:"link"`

	// Inactive is a flag indicating that this object is inactive for now.
	// An object can be created as inactive which means it is not delivered to its destination. The object can be activated later.
	// Optional field, default is false (object active).
	Inactive bool `json:"inactive" bson:"inactive"`

	// ActivationTime is a timestamp/date as to when this object should automatically be activated.
	// The timestamp should be provided in RFC3339 format.
	// Optional field, if omitted (and Inactive is true) the object is never automatically activated.
	ActivationTime string `json:"activationTime" bson:"activation-time"`

	// NoData is a flag indicating that there is no data for this object.
	// Objects with no data can be used, for example, to send notifications.
	// Optional field, default is false (object includes data).
	NoData bool `json:"noData" bson:"no-data"`

	// MetaOnly is a flag that indicates that this update is only of the metadata. The current object's data is left unchanged.
	// Optional field, default is false (both data and metadata are updated).
	MetaOnly bool `json:"metaOnly" bson:"meta-only"`

	// DestinationDataURI is a URI indicating where the receiver of the object should store it.
	// Currently only file URIs are supported.
	// This field is available only when working with the CSS.
	// Optional field, if omitted the object is stored in the node's internal storage.
	DestinationDataURI string `json:"destinationDataUri" bson:"data-uri"`

	// SourceDataURI is a URI indicating where the sender of the object should read the data from.
	// Currently only file URIs are supported.
	// This field is available only when working with the ESS.
	// Optional field, if omitted the object's data should be provided by the user.
	SourceDataURI string `json:"sourceDataUri" bson:"source-data-uri"`

	// ExpectedConsumers is the number of applications that are expected to indicate that they have consumed the object.
	// Optional field, default is 1.
	ExpectedConsumers int `json:"consumers" bson:"consumers"`

	// AutoDelete is a flag indicating whether to delete the object after it is delivered to all its destinations from the DestinationsList.
	// Optional field, default is false (do not delete).
	// This field is used only when working with the CSS. Objects are always deleted after delivery on the ESS.
	AutoDelete bool `json:"autodelete" bson:"autodelete"`

	// OriginID is the ID of origin of the object. Set by the internal code.
	// Read only field, should not be set by users.
	OriginID string `json:"originID" bson:"origin-id"`

	// OriginType is the type of origin of the object. Set by the internal code.
	// Read only field, should not be set by users.
	OriginType string `json:"originType" bson:"origin-type"`

	// Deleted is a flag indicating to applications polling for updates that this object has been deleted.
	// Read only field, should not be set by users.
	Deleted bool `json:"deleted" bson:"deleted"`

	// InstanceID is an internal instance ID.
	// This field should not be set by users.
	InstanceID int64 `json:"instanceID" bson:"instance-id"`

	// DataID is an internal data ID.
	// This field should not be set by users.
	DataID int64 `json:"dataID" bson:"data-id"`

	// ObjectSize is an internal field indicating the size of the object's data.
	// This field should not be set by users.
	ObjectSize int64 `json:"objectSize" bson:"object-size"`

	// ChunkSize is an internal field indicating the maximal message payload size.
	// This field should not be set by users.
	ChunkSize int `json:"chunkSize" bson:"chunk-size"`

	// UploadChunkSize is an internal field indicating the upload chunk size used when uploading the
	// the model (if chunking was used)
	// This field should not be set by users.
	UploadChunkSize int64 `json:"uploadChunkSize" bson:"upload-chunk-size"`

	// HashAlgorithm used for data signature sign/verification. "SHA1" and "SHA256" are supported hash algorithms.
	// Valid values are: "SHA1", "SHA256"
	// Optional field, if omitted the data signature/verification will not be applied
	HashAlgorithm string `json:"hashAlgorithm" bson:"hash-algorithm"`

	// PublicKey is a base64 encoded string. It is the publicKey to verify the data of the object
	// Optional field, if omitted the data will not be verified with public key and signature
	PublicKey string `json:"publicKey" bson:"public-key"`

	// Signature is a base64 encoded string. It is the data signature to verify data of the object
	// Optional field, if omitted the data will not be verified with public key and signature
	Signature string `json:"signature" bson:"signature"`

	// Public is a flag indicate this object is visiable to all users in all orgs
	// Optional field, default is false (not visiable to all users)
	Public bool `json:"public" bson:"public"`

	// OwnerID is an internal field indicating who creates the object
	// This field should not be set by users
	OwnerID string `json:"ownerID" bson:"owner-id"`
}

MetaData is the metadata that identifies and defines the sync service object. Every object includes metadata (mandatory) and data (optional). The metadata and data can be updated independently. Each sync service node (ESS) has an address that is composed of the node's ID, Type, and Organization. To send an object to a single node set the destinationType and destinationID fields to match the node's Type and ID. To send an object to all the nodes of a certain type set destinationType to the appropriate type and leave destinationID empty. If both destinationType and destinationID are empty the object is sent to all nodes. swagger:model

type NotFound

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

NotFound is the error returned if an object wasn't found

func (*NotFound) Error

func (e *NotFound) Error() string

type Notification

type Notification struct {
	ObjectID   string `json:"objectID" bson:"object-id"`
	ObjectType string `json:"objectType" bson:"object-type"`
	DestOrgID  string `json:"destinationOrgID" bson:"destination-org-id"`
	DestID     string `json:"destinationID" bson:"destination-id"`
	DestType   string `json:"destinationType" bson:"destination-type"`
	Status     string `json:"status" bson:"status"`
	InstanceID int64  `json:"instanceID" bson:"instance-id"`
	DataID     int64  `json:"dataID" bson:"data-id"`
	ResendTime int64  `json:"resendTime" bson:"resend-time"`
}

Notification is used to store notifications in the store swagger:ignore

type NotificationInfo

type NotificationInfo struct {
	NotificationTopic string
	DestType          string
	DestID            string
	InstanceID        int64
	DataID            int64
	MetaData          *MetaData
}

NotificationInfo contains information about a message to send to the other side

type ObjectDestinationPolicy

type ObjectDestinationPolicy struct {
	// OrgID is the organization ID of the object (an object belongs to exactly one organization).
	//   required: true
	OrgID string `json:"orgID"`

	// ObjectType is the type of the object.
	// The type is used to group multiple objects, for example when checking for object updates.
	//   required: true
	ObjectType string `json:"objectType"`

	// ObjectID is a unique identifier of the object
	//   required: true
	ObjectID string `json:"objectID"`

	// DestinationPolicy is the policy specification that should be used to distribute this object
	// to the appropriate set of destinations.
	DestinationPolicy *Policy `json:"destinationPolicy,omitempty"`

	// Destinations is the list of the object's current destinations
	Destinations []DestinationsStatus `json:"destinations"`
}

ObjectDestinationPolicy contains information about an object that has a Destination Policy. swagger:model

type ObjectInQueue added in v1.6.7

type ObjectInQueue struct {
	NotificationAction string // Notification status and type
	NotificationType   string
	Object             MetaData
	Destinations       []StoreDestinationStatus //use this list if NotificationType is common.TypeDestination
}

type ObjectInVerifyQueue added in v1.6.8

type ObjectInVerifyQueue struct {
	Object MetaData
}

type ObjectStatus

type ObjectStatus struct {
	// OrgID is the organization ID of the organization
	OrgID string `json:"orgID"`

	// ObjectType is the object type
	//   required: true
	ObjectType string `json:"objectType"`

	// ObjectID is the object ID
	//   required: true
	ObjectID string `json:"objectID"`

	// Status is the object status for this destination
	//   required: true
	//   enum: delivering,delivered,consumed,deleted,error
	Status string `json:"status"`
}

ObjectStatus describes the delivery status of an object for a destination The status can be one of the following: Indication whether the object has been delivered to the destination

delivering - indicates that the object is being delivered
delivered - indicates that the object was delivered
consumed - indicates that the object was consumed
deleted - indicates that this destination acknowledged the deletion of the object
error - indicates that a feedback error message was received

swagger:model

type Organization

type Organization struct {
	// OrgID is the organization ID of the organization
	OrgID string `json:"orgID" bson:"org-id"`

	// User is the user name to be used when connecting to this organization
	User string `json:"user" bson:"user"`

	// Password is the password to be used when connecting to this organization
	Password string `json:"password" bson:"password"`

	// Address is the broker address to be used when connecting to this organization
	Address string `json:"address" bson:"address"`
}

Organization contains organization's information swagger:model

type PathError

type PathError struct {
	Message string
}

PathError is the error for path issues

func (*PathError) Error

func (e *PathError) Error() string

type Policy

type Policy struct {
	// Properties is the set of properties for a particular policy
	Properties []PolicyProperty `json:"properties" bson:"properties"`

	// Constraints is a set of expressions that form the constraints for the policy
	Constraints []string `json:"constraints" bson:"constraints"`

	// Services is the list of services this object has affinity for
	Services []ServiceID `json:"services" bson:"services"`

	// Timestamp indicates when the policy was last updated (result of time.Now().UTC().UnixNano())
	Timestamp int64 `json:"timestamp" bson:"timestamp"`
}

Policy describes a policy made up of a set of properties and constraints swagger:model

type PolicyProperty

type PolicyProperty struct {
	// Name is the name of the property
	//   required: true
	Name string `json:"name" bson:"name"`

	// Value is the value of the property
	//   required: true
	Value interface{} `json:"value" bson:"value"`

	// Type is the type of the property.
	// It is only required where the system can't interpret the value correctly by context.
	//   required: false
	Type string `json:"type" bson:"type"`
}

PolicyProperty is a property in a policy swagger:model

type SecurityError

type SecurityError struct {
	Message string
}

SecurityError is the error for requests failed because of security

func (*SecurityError) Error

func (e *SecurityError) Error() string

type SemVer

type SemVer struct {
	Version  int64
	Minor    int64
	Fix      int64
	Infinity bool
}

SemVer represents a semantic version

func ParseSemVer

func ParseSemVer(input string) (*SemVer, error)

ParseSemVer parses a semantic version string and returns a SemVer

func (*SemVer) Compare

func (semVer *SemVer) Compare(b *SemVer) int

Compare compares a pair of SemVers

func (*SemVer) String

func (semVer *SemVer) String() string

String converts a SemVer to a string

type SemVerRange

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

SemVerRange represents a range over semantic version

func ParseSemVerRange

func ParseSemVerRange(input string) (*SemVerRange, error)

ParseSemVerRange parses a semantic version range string and returns a SemVerRange

func (*SemVerRange) IsInRange

func (semVerRange *SemVerRange) IsInRange(semVer *SemVer) bool

IsInRange returns true/false if the SemVer is in the range of the SemVerRange

type ServiceID

type ServiceID struct {
	// OrgID is the organization ID of the service
	OrgID string `json:"orgID" bson:"org-id"`

	// Arch is the architecture of the service
	Arch string `json:"arch" bson:"arch"`

	// ServiceName is the name of the service
	ServiceName string `json:"serviceName" bson:"service-name"`

	// Version is the version of the service
	Version string `json:"version" bson:"version"`
}

ServiceID contains the ID of a service to which an object may have affinity for swagger:model

func GetRemovedPolicyServices

func GetRemovedPolicyServices(existingPolicy *Policy, newPolicy *Policy) []ServiceID

GetRemovedPolicyServices is the method to compare existing destination policy and new destination policy, returning removed policy services

func RemoveServiceFromServiceList

func RemoveServiceFromServiceList(serviceID string, serviceList []ServiceID) ([]ServiceID, bool)

RemoveServiceFromServiceList removes a service from the given service list and return it. Returns false if nothing removed from the list

type SetupError

type SetupError struct {
	Message string
}

SetupError is the error for setup issues swagger:ignore

func (*SetupError) Error

func (e *SetupError) Error() string

type StoreDestinationStatus

type StoreDestinationStatus struct {
	Destination Destination `bson:"destination"`
	Status      string      `bson:"status"`
	Message     string      `bson:"message"`
}

StoreDestinationStatus is the information about destinations and their status for an object swagger:ignore

type StoredOrganization

type StoredOrganization struct {
	Org       Organization
	Timestamp time.Time
}

StoredOrganization contains organization and its update timestamp

type SyncServiceError

type SyncServiceError error

SyncServiceError is a common error type used in the sync service swagger:ignore

func CreateError

func CreateError(err error, message string) SyncServiceError

CreateError creates a sync-service error from a Go error

func GetHash added in v1.6.2

func GetHash(hashAlgo string) (hash.Hash, crypto.Hash, SyncServiceError)

GetHash returns the hash object and crypto hash algo name (used by rsa.VerifyPSS() func) of specified hash algorithm

func GetStartAndEndRangeFromContentRangeHeader added in v1.6.8

func GetStartAndEndRangeFromContentRangeHeader(request *http.Request) (int64, int64, int64, SyncServiceError)

Content-Range: bytes 1-2/*\ Returns totalsize, startOffset, endOffset, err

func GetStartAndEndRangeFromRangeHeader added in v1.6.8

func GetStartAndEndRangeFromRangeHeader(request *http.Request) (int64, int64, SyncServiceError)

func ValidateDestinationListInput

func ValidateDestinationListInput(destinationsList []string) (bool, SyncServiceError)

ValidateDestinationListInput checks if destinationsList contains < or >, to avoid injecting html like tags from user

type SyncServiceVersion

type SyncServiceVersion struct {
	Major uint32
	Minor uint32
}

SyncServiceVersion is the current version of the Sync-Service

var Version SyncServiceVersion

Version is the current version of the Sync-Service

type TooManyRequestError added in v1.9.5

type TooManyRequestError struct {
	Message string
}

TooManyRequestError is the error for too many request

func (*TooManyRequestError) Error added in v1.9.5

func (e *TooManyRequestError) Error() string

type UsageInfo

type UsageInfo struct {
	ClientRequests uint64 `json:"clientRequests"`
	RegisteredESS  uint32 `json:"registeredESS"`
	StoredObjects  uint32 `json:"storedObjects"`
}

UsageInfo describes the usage of the sync-service node swagger:model

var HealthUsageInfo UsageInfo

HealthUsageInfo describes the usage of the sync-service node

Jump to

Keyboard shortcuts

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