base

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 35 Imported by: 11

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 AddObjectDestinations added in v1.6.5

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

AddObjectDestinations adds destinations to object's destination list

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 DeleteObjectDestinations added in v1.6.5

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

DeleteObjectDestinations deletes destinations from object's destination list

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, objectType string) ([]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 GetListOfObjTypes added in v1.8.4

func GetListOfObjTypes(objMetaList []common.MetaData) []string

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 GetObjectDataByChunk added in v1.6.9

func GetObjectDataByChunk(orgID string, objectType string, objectID string, startOffset int64, endOffset int64) (int64, io.Reader, bool, int, common.SyncServiceError)

GetObjectDataByChunk delivers object partial data to the app Call the storage module to get the object's data within range 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, deleted *bool) ([]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 PutObjectAllData added in v1.6.8

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

PutObjectAllData 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 PutObjectChunkData added in v1.6.8

func PutObjectChunkData(orgID string, objectType string, objectID string, dataReader io.Reader, startOffset int64, endOffset int64, totalSize int64) (bool, common.SyncServiceError)

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

type ObjectVerifyQueue added in v1.6.8

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

func NewObjectVerifyQueue added in v1.6.8

func NewObjectVerifyQueue(bufferSize uint64) *ObjectVerifyQueue

Only support doing data verification at sender side

func (*ObjectVerifyQueue) Close added in v1.6.8

func (q *ObjectVerifyQueue) Close()

func (*ObjectVerifyQueue) SendObjectToQueue added in v1.6.8

func (q *ObjectVerifyQueue) SendObjectToQueue(objectInVerifyQueue common.ObjectInVerifyQueue)

type ObjectWorkQueue added in v1.6.8

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

func NewObjectWorkQueue added in v1.6.8

func NewObjectWorkQueue(bufferSize uint64) *ObjectWorkQueue

func (*ObjectWorkQueue) Close added in v1.6.8

func (q *ObjectWorkQueue) Close()

func (*ObjectWorkQueue) SendObjectToQueue added in v1.6.8

func (q *ObjectWorkQueue) SendObjectToQueue(objectInQueue common.ObjectInQueue)

Jump to

Keyboard shortcuts

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