memory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

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

MemoryStore implements storage.RegistryStore using in-memory maps. This is the default storage implementation and is lock-free since it's accessed only by the single event queue worker.

func NewMemoryStore

func NewMemoryStore() *MemoryStore

NewMemoryStore creates a new in-memory storage instance

func (*MemoryStore) AddSubscription

func (m *MemoryStore) AddSubscription(ctx context.Context, subscriberKey string, serviceGroup string) error

AddSubscription adds a subscriber to a service group

func (*MemoryStore) Close

func (m *MemoryStore) Close() error

Close is a no-op for memory storage

func (*MemoryStore) DeleteService

func (m *MemoryStore) DeleteService(ctx context.Context, key string) error

DeleteService removes a service entry by its composite key

func (*MemoryStore) GetAllServices

func (m *MemoryStore) GetAllServices(ctx context.Context) ([]*models.ServiceInfo, error)

GetAllServices retrieves all registered services

func (*MemoryStore) GetService

func (m *MemoryStore) GetService(ctx context.Context, key string) (*models.ServiceInfo, error)

GetService retrieves a single service by its composite key

func (*MemoryStore) GetServicesByName

func (m *MemoryStore) GetServicesByName(ctx context.Context, serviceName string) ([]*models.ServiceInfo, error)

GetServicesByName retrieves all pods for a given service name

func (*MemoryStore) GetSubscriberServices

func (m *MemoryStore) GetSubscriberServices(ctx context.Context, serviceGroup string) ([]*models.ServiceInfo, error)

GetSubscriberServices returns full ServiceInfo objects for all subscribers

func (*MemoryStore) GetSubscribers

func (m *MemoryStore) GetSubscribers(ctx context.Context, serviceGroup string) ([]string, error)

GetSubscribers returns all subscriber keys for a given service group

func (*MemoryStore) Ping

func (m *MemoryStore) Ping(ctx context.Context) error

Ping always succeeds for memory storage

func (*MemoryStore) RemoveAllSubscriptions

func (m *MemoryStore) RemoveAllSubscriptions(ctx context.Context, subscriberKey string) error

RemoveAllSubscriptions removes all subscriptions for a given subscriber

func (*MemoryStore) RemoveSubscription

func (m *MemoryStore) RemoveSubscription(ctx context.Context, subscriberKey string, serviceGroup string) error

RemoveSubscription removes a subscriber from a service group

func (*MemoryStore) SaveService

func (m *MemoryStore) SaveService(ctx context.Context, service *models.ServiceInfo) error

SaveService stores or updates a service entry

func (*MemoryStore) UpdateHealthStatus

func (m *MemoryStore) UpdateHealthStatus(ctx context.Context, key string, status models.ServiceStatus, timestamp time.Time) error

UpdateHealthStatus updates the health status and last check timestamp

Jump to

Keyboard shortcuts

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