nats

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnector

func NewConnector(core Core) data.Connector

func NewEntityManager

func NewEntityManager(core Core) data.ModifiableEntityManager

func NewFieldOperator

func NewFieldOperator(core Core) data.ModifiableFieldOperator

func NewNotificationConsumer

func NewNotificationConsumer(core Core) data.ModifiableNotificationConsumer

func NewNotificationPublisher

func NewNotificationPublisher(core Core) data.ModifiableNotificationPublisher

func NewSchemaManager

func NewSchemaManager(core Core) data.ModifiableSchemaManager

func NewSnapshotManager

func NewSnapshotManager(core Core) data.ModifiableSnapshotManager

Types

type Config

type Config struct {
	Address string
}

type Connector

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

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context)

func (*Connector) Connected added in v0.1.3

func (c *Connector) Connected() signalslots.Signal

func (*Connector) Disconnect

func (c *Connector) Disconnect(ctx context.Context)

func (*Connector) Disconnected added in v0.1.3

func (c *Connector) Disconnected() signalslots.Signal

func (*Connector) IsConnected

func (c *Connector) IsConnected(ctx context.Context) bool

type Core

type Core interface {
	Connect(ctx context.Context)
	Disconnect(ctx context.Context)
	IsConnected(ctx context.Context) bool
	Publish(subject string, msg proto.Message) error
	Request(ctx context.Context, subject string, msg proto.Message) (*protobufs.ApiMessage, error)
	Subscribe(subject string, handler natsgo.MsgHandler)
	SetConfig(config Config)
	GetConfig() Config
	GetKeyGenerator() KeyGenerator
	QueueSubscribe(subject string, handler natsgo.MsgHandler)

	SetAuthProvider(data.AuthProvider)

	Connected() signalslots.Signal
	Disconnected() signalslots.Signal
}

func NewCore

func NewCore(config Config) Core

type EntityManager

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

func (*EntityManager) CreateEntity

func (me *EntityManager) CreateEntity(ctx context.Context, entityType, parentId, name string) string

func (*EntityManager) DeleteEntity

func (me *EntityManager) DeleteEntity(ctx context.Context, entityId string)

func (*EntityManager) EntityExists added in v0.1.5

func (me *EntityManager) EntityExists(ctx context.Context, entityId string) bool

func (*EntityManager) FindEntities

func (me *EntityManager) FindEntities(ctx context.Context, entityType string) []string

func (*EntityManager) GetEntity

func (me *EntityManager) GetEntity(ctx context.Context, entityId string) data.Entity

func (*EntityManager) GetEntityTypes

func (me *EntityManager) GetEntityTypes(ctx context.Context) []string

func (*EntityManager) SetFieldOperator

func (me *EntityManager) SetFieldOperator(fo data.FieldOperator)

func (*EntityManager) SetSchemaManager

func (me *EntityManager) SetSchemaManager(sm data.SchemaManager)

type FieldOperator

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

func (*FieldOperator) Read

func (me *FieldOperator) Read(ctx context.Context, requests ...data.Request)

func (*FieldOperator) SetEntityManager

func (me *FieldOperator) SetEntityManager(em data.EntityManager)

func (*FieldOperator) SetNotificationPublisher

func (me *FieldOperator) SetNotificationPublisher(np data.NotificationPublisher)

func (*FieldOperator) SetSchemaManager

func (me *FieldOperator) SetSchemaManager(sm data.SchemaManager)

func (*FieldOperator) Write

func (me *FieldOperator) Write(ctx context.Context, requests ...data.Request)

type KeyGenerator

type KeyGenerator interface {
	GetReadSubject() string
	GetWriteSubject() string
	GetNotificationRegistrationSubject() string
	GetNotificationGroupSubject(serviceId string) string
	GetDistributedNotificationGroupSubject(serviceId string) string
}

func NewKeyGenerator

func NewKeyGenerator() KeyGenerator

type NotificationConsumer

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

func (*NotificationConsumer) Consumed added in v0.1.3

func (me *NotificationConsumer) Consumed() signalslots.Signal

func (*NotificationConsumer) Notify

func (*NotificationConsumer) Unnotify

func (me *NotificationConsumer) Unnotify(ctx context.Context, token string)

func (*NotificationConsumer) UnnotifyCallback

func (me *NotificationConsumer) UnnotifyCallback(ctx context.Context, token string, cb data.NotificationCallback)

type NotificationPublisher

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

func (*NotificationPublisher) PublishNotifications

func (p *NotificationPublisher) PublishNotifications(ctx context.Context, curr data.Request, prev data.Request)

func (*NotificationPublisher) SetEntityManager

func (p *NotificationPublisher) SetEntityManager(em data.EntityManager)

func (*NotificationPublisher) SetFieldOperator

func (p *NotificationPublisher) SetFieldOperator(fo data.FieldOperator)

type SchemaManager

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

func (*SchemaManager) FieldExists

func (me *SchemaManager) FieldExists(ctx context.Context, fieldName, entityType string) bool

func (*SchemaManager) GetEntitySchema

func (me *SchemaManager) GetEntitySchema(ctx context.Context, entityType string) data.EntitySchema

func (*SchemaManager) GetFieldSchema

func (me *SchemaManager) GetFieldSchema(ctx context.Context, fieldName, entityType string) data.FieldSchema

func (*SchemaManager) SetEntityManager

func (me *SchemaManager) SetEntityManager(em data.EntityManager)

func (*SchemaManager) SetEntitySchema

func (me *SchemaManager) SetEntitySchema(ctx context.Context, schema data.EntitySchema)

func (*SchemaManager) SetFieldOperator

func (me *SchemaManager) SetFieldOperator(fo data.FieldOperator)

func (*SchemaManager) SetFieldSchema

func (me *SchemaManager) SetFieldSchema(ctx context.Context, entityType, fieldName string, schema data.FieldSchema)

type SnapshotManager

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

func (*SnapshotManager) CreateSnapshot

func (s *SnapshotManager) CreateSnapshot(ctx context.Context) data.Snapshot

func (*SnapshotManager) RestoreSnapshot

func (s *SnapshotManager) RestoreSnapshot(ctx context.Context, ss data.Snapshot)

func (*SnapshotManager) SetEntityManager

func (s *SnapshotManager) SetEntityManager(em data.EntityManager)

func (*SnapshotManager) SetFieldOperator

func (s *SnapshotManager) SetFieldOperator(fo data.FieldOperator)

func (*SnapshotManager) SetSchemaManager

func (s *SnapshotManager) SetSchemaManager(sm data.SchemaManager)

Jump to

Keyboard shortcuts

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