memory

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is an in-memory implementation of SchemaRegistry Useful for testing and development.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new in-memory registry.

func (*Registry) Clear

func (r *Registry) Clear()

Clear removes all manifests and schemas (useful for testing).

func (*Registry) Close

func (r *Registry) Close() error

Close closes the registry and cleans up resources.

func (*Registry) DeleteManifest

func (r *Registry) DeleteManifest(ctx context.Context, instanceID string) error

DeleteManifest removes a schema manifest.

func (*Registry) DeleteSchema

func (r *Registry) DeleteSchema(ctx context.Context, path string) error

DeleteSchema removes a schema from the registry.

func (*Registry) FetchSchema

func (r *Registry) FetchSchema(ctx context.Context, path string) (any, error)

FetchSchema retrieves a schema from the registry.

func (*Registry) GetManifest

func (r *Registry) GetManifest(ctx context.Context, instanceID string) (*farp.SchemaManifest, error)

GetManifest retrieves a schema manifest by instance ID.

func (*Registry) Health

func (r *Registry) Health(ctx context.Context) error

Health checks if the registry is healthy.

func (*Registry) ListManifests

func (r *Registry) ListManifests(ctx context.Context, serviceName string) ([]*farp.SchemaManifest, error)

ListManifests lists all manifests for a service name.

func (*Registry) PublishSchema

func (r *Registry) PublishSchema(ctx context.Context, path string, schema any) error

PublishSchema stores a schema in the registry.

func (*Registry) RegisterManifest

func (r *Registry) RegisterManifest(ctx context.Context, manifest *farp.SchemaManifest) error

RegisterManifest registers a new schema manifest.

func (*Registry) UpdateManifest

func (r *Registry) UpdateManifest(ctx context.Context, manifest *farp.SchemaManifest) error

UpdateManifest updates an existing schema manifest.

func (*Registry) WatchManifests

func (r *Registry) WatchManifests(ctx context.Context, serviceName string, onChange farp.ManifestChangeHandler) error

WatchManifests watches for manifest changes for a service.

func (*Registry) WatchSchemas

func (r *Registry) WatchSchemas(ctx context.Context, path string, onChange farp.SchemaChangeHandler) error

WatchSchemas watches for schema changes at a specific path.

Jump to

Keyboard shortcuts

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