base

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFile string

ConfigFile configuration file name loaded by command line argument

Functions

func ActivateObject

func ActivateObject(orgID string, objectType string, objectID string) common.SyncServiceError

ActivateObject activates an inactive object Call the storage module to activate the object and return the response

func AddUsersToACL

func AddUsersToACL(aclType string, orgID string, key string, usernames []common.ACLentry) common.SyncServiceError

AddUsersToACL adds users to an ACL. Note: Adding the first user to such an ACL automatically creates it.

func AddWaiterForStartup

func AddWaiterForStartup(channel chan int) error

AddWaiterForStartup adds another channel for someone waiting for the Sync Service to start

func BlockUntilShutdown

func BlockUntilShutdown()

BlockUntilShutdown blocks the current "thread"

func ConfigStandaloneSyncService

func ConfigStandaloneSyncService()

ConfigStandaloneSyncService Configures a standalone Sync Service

func DeleteObject

func DeleteObject(orgID string, objectType string, objectID string) common.SyncServiceError

DeleteObject deletes an object from storage Call the storage module to delete the object and return the response

func DeleteWebhook

func DeleteWebhook(orgID string, objectType string, url string) common.SyncServiceError

DeleteWebhook deletes a WebHook

func GetAccessibleObjects added in v0.10.12

func GetAccessibleObjects(code int, orgID string, userOrgID string, userID string, objects []common.MetaData) ([]common.MetaData, error)

func GetAccessibleObjectsDestinationPolicy added in v0.10.12

func GetAccessibleObjectsDestinationPolicy(code int, orgID string, userOrgID string, userID string, objects []common.ObjectDestinationPolicy) ([]common.ObjectDestinationPolicy, error)

func GetObject

func GetObject(orgID string, objectType string, objectID string) (*common.MetaData, common.SyncServiceError)

GetObject delivers an object to the app Call the storage module to get the object's meta data and send it to the app

func GetObjectData

func GetObjectData(orgID string, objectType string, objectID string) (io.Reader, common.SyncServiceError)

GetObjectData delivers object data to the app Call the storage module to get the object's data and send it to the app

func GetObjectDestinationsStatus

func GetObjectDestinationsStatus(orgID string, objectType string, objectID string) ([]common.DestinationsStatus, common.SyncServiceError)

GetObjectDestinationsStatus gets the destinations of the object and their statuses

func GetObjectStatus

func GetObjectStatus(orgID string, objectType string, objectID string) (string, common.SyncServiceError)

GetObjectStatus sends the status of the object to the app Call the storage module to get the status of the object and return it in the response

func GetObjectsForDestination

func GetObjectsForDestination(orgID string, destType string, destID string) ([]common.ObjectStatus, common.SyncServiceError)

GetObjectsForDestination gets objects that are in use on a given node

func GetRemovedDestinationPolicyServicesFromESS

func GetRemovedDestinationPolicyServicesFromESS(orgID string, objectType string, objectID string) ([]common.ServiceID, common.SyncServiceError)

GetRemovedDestinationPolicyServicesFromESS get the removedDestinationPolicyServices list Call the storage module to get the object's removedDestinationPolicyServices

func ListAllObjects

func ListAllObjects(orgID string, objectType string) ([]common.ObjectDestinationPolicy, common.SyncServiceError)

ListAllObjects provides a list of all objects with the specified type

func ListDestinations

func ListDestinations(orgID string) ([]common.Destination, common.SyncServiceError)

ListDestinations lists all destinations

func ListObjectsWithDestinationPolicy

func ListObjectsWithDestinationPolicy(orgID string, received bool) ([]common.ObjectDestinationPolicy, common.SyncServiceError)

ListObjectsWithDestinationPolicy provides a list of objects that have a DestinationPolicy

func ListObjectsWithDestinationPolicyByService

func ListObjectsWithDestinationPolicyByService(orgID, serviceOrgID, serviceName string) ([]common.ObjectDestinationPolicy, common.SyncServiceError)

ListObjectsWithDestinationPolicyByService provides a list of objects that have a DestinationPolicy and are associated with a service

func ListObjectsWithDestinationPolicyUpdatedSince

func ListObjectsWithDestinationPolicyUpdatedSince(orgID string, since int64) ([]common.ObjectDestinationPolicy, common.SyncServiceError)

ListObjectsWithDestinationPolicyUpdatedSince provides a list of objects that have a DestinationPolicy that has been updated since the specified time

func ListObjectsWithFilters

func ListObjectsWithFilters(orgID string, destinationPolicy *bool, dpServiceOrgID string, dpServiceName string, dpPropertyName string, since int64, objectType string, objectID string, destinationType string, destinationID string, noData *bool, expirationTimeBefore string) ([]common.MetaData, common.SyncServiceError)

ListObjectsWithFilters provides a list of objects that satisfy the given conditions

func ListUpdatedObjects

func ListUpdatedObjects(orgID string, objectType string, received bool) ([]common.MetaData, common.SyncServiceError)

ListUpdatedObjects provides a list of edge updated objects Call the storage module to get the list of edge updated objects and send it to the app

func ObjectConsumed

func ObjectConsumed(orgID string, objectType string, objectID string) common.SyncServiceError

ObjectConsumed is used when an app indicates that it consumed the object Send "consumed" notification to the object's origin Call the storage module to mark the object as consumed

func ObjectDeleted

func ObjectDeleted(userID string, orgID string, objectType string, objectID string) common.SyncServiceError

ObjectDeleted is called when an app indicates that 1) it deleted the object, or 2) service acknowlege service reference change For 1): Send "deleted" notification to the object's origin Call the storage module to delete the object if deleted by all the consumers For 2): service will be removed from ESS lastDestinationPolicyServices array

func ObjectPolicyReceived

func ObjectPolicyReceived(orgID string, objectType string, objectID string) common.SyncServiceError

ObjectPolicyReceived is called when an application wants to mark an object as having received its destination policy

func ObjectReceived

func ObjectReceived(orgID string, objectType string, objectID string) common.SyncServiceError

ObjectReceived is called when an app indicates that it received the object Call the storage module to mark the object as received

func PutObjectData

func PutObjectData(orgID string, objectType string, objectID string, dataReader io.Reader) (bool, common.SyncServiceError)

PutObjectData stores an object's data Verify data signature (if publicKey and signature both have value) Call the storage module to store the object's data Return true if the object was found and updated Return false and no error if the object was not found

func RegisterWebhook

func RegisterWebhook(orgID string, objectType string, webhook string) common.SyncServiceError

RegisterWebhook registers a WebHook

func RemoveUsersFromACL

func RemoveUsersFromACL(aclType string, orgID string, key string, users []common.ACLentry) common.SyncServiceError

RemoveUsersFromACL removes users from an ACL. Note: Removing the last user from such an ACL automatically deletes it.

func ResendObjects

func ResendObjects() common.SyncServiceError

ResendObjects asks the other side to resend all the relevant objects

func RetrieveACL

func RetrieveACL(aclType string, orgID string, key string, aclUserType string) ([]common.ACLentry, common.SyncServiceError)

RetrieveACL retrieves the list of users in the specified ACL

func RetrieveACLsInOrg

func RetrieveACLsInOrg(aclType string, orgID string) ([]string, common.SyncServiceError)

RetrieveACLsInOrg retrieves the list of ACLs (object type/destination type) of the specified type in an organization

func StandaloneSyncService

func StandaloneSyncService(auth security.Authentication)

StandaloneSyncService runs a standalone Sync Service

func Start

func Start(swaggerFile string, registerHandlers bool) common.SyncServiceError

Start starts up the sync service

func Stop

func Stop(quiesceTime int, unregisterSelf bool)

Stop stops the Sync Server

func UpdateObject

func UpdateObject(orgID string, objectType string, objectID string, metaData common.MetaData, data []byte) common.SyncServiceError

UpdateObject invoked when an app sends an updated object

func UpdateObjectDestinations

func UpdateObjectDestinations(orgID string, objectType string, objectID string, destinationsList []string) common.SyncServiceError

UpdateObjectDestinations updates object's destinations

Types

This section is empty.

Jump to

Keyboard shortcuts

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