managers

package
v0.0.0-...-cc9b1f3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatatypeManager

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

DatatypeManager manages Orda datatypes regarding operations

func NewDatatypeManager

func NewDatatypeManager(ctx *context.ClientContext, sm *SyncManager) *DatatypeManager

NewDatatypeManager creates a new instance of DatatypeManager

func (*DatatypeManager) DeliverTransaction

func (its *DatatypeManager) DeliverTransaction(wired iface.WiredDatatype)

DeliverTransaction delivers a transaction

func (*DatatypeManager) ExistDatatype

func (its *DatatypeManager) ExistDatatype(key string, typeOf model.TypeOfDatatype) (iface.Datatype, errors.OrdaError)

ExistDatatype returns the datatype if the specified key and type

func (*DatatypeManager) Get

func (its *DatatypeManager) Get(key string) iface.Datatype

Get returns a datatype for the specified key

func (*DatatypeManager) OnChangeDatatypeState

func (its *DatatypeManager) OnChangeDatatypeState(dt iface.Datatype, state model.StateOfDatatype) errors.OrdaError

OnChangeDatatypeState deals with what datatypeManager has to do when the state of datatype changes.

func (*DatatypeManager) ReceiveNotification

func (its *DatatypeManager) ReceiveNotification(topic string, notification model.Notification)

ReceiveNotification enables datatype to sync when it receives notification

func (*DatatypeManager) SubscribeOrCreate

func (its *DatatypeManager) SubscribeOrCreate(dt iface.Datatype, state model.StateOfDatatype) errors.OrdaError

SubscribeOrCreate links a datatype with the datatype

func (*DatatypeManager) SyncAll

func (its *DatatypeManager) SyncAll() errors.OrdaError

SyncAll enables all the subscribed datatypes to be synchronized.

type NotifyManager

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

NotifyManager manages notifications from Orda Server

func NewNotifyManager

func NewNotifyManager(ctx *context.ClientContext, pubSubAddr string, cm *model.Client) *NotifyManager

NewNotifyManager creates an instance of NotifyManager

func (*NotifyManager) Close

func (its *NotifyManager) Close()

Close closes a connection with Orda notification server.

func (*NotifyManager) Connect

func (its *NotifyManager) Connect() errors.OrdaError

Connect make a connection with Orda notification server.

func (*NotifyManager) SetReceiver

func (its *NotifyManager) SetReceiver(receiver notificationReceiver)

SetReceiver sets receiver which is going to receive notifications, i.e., DatatypeManager

func (*NotifyManager) SubscribeNotification

func (its *NotifyManager) SubscribeNotification(topic string) errors.OrdaError

SubscribeNotification subscribes notification for a topic.

type SyncManager

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

SyncManager is a manager exchanging request and response with Orda server.

func NewSyncManager

func NewSyncManager(
	ctx *context.ClientContext,
	client *model.Client,
	serverAddr string,
	notificationAddr string,
) *SyncManager

NewSyncManager creates an instance of SyncManager.

func (*SyncManager) Close

func (its *SyncManager) Close() errors.OrdaError

Close closes connections with Orda GRPC and notification servers.

func (*SyncManager) Connect

func (its *SyncManager) Connect() errors.OrdaError

Connect makes connections with Orda GRPC and notification servers.

func (*SyncManager) ExchangeClientRequestResponse

func (its *SyncManager) ExchangeClientRequestResponse() errors.OrdaError

ExchangeClientRequestResponse exchanges CLIENT_REQUEST and CLIENT_RESPONSE

func (*SyncManager) Sync

func (its *SyncManager) Sync(pppList ...*model.PushPullPack) (*model.PushPullMessage, errors.OrdaError)

Sync exchanges PUSHPULL_REQUEST and PUSHPULL_RESPONSE

Jump to

Keyboard shortcuts

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