adapters

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreCacheAdapter

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

CoreCacheAdapter adapts CacheClient to the core.Cache interface.

func NewCoreCacheAdapter

func NewCoreCacheAdapter(client *cacherepo.CacheClient) *CoreCacheAdapter

func (*CoreCacheAdapter) Close

func (a *CoreCacheAdapter) Close() error

func (*CoreCacheAdapter) Delete

func (a *CoreCacheAdapter) Delete(ctx context.Context, key string) error

func (*CoreCacheAdapter) Get

func (a *CoreCacheAdapter) Get(ctx context.Context, key string) ([]byte, bool, error)

func (*CoreCacheAdapter) InvalidatePrefix

func (a *CoreCacheAdapter) InvalidatePrefix(ctx context.Context, prefix string) error

func (*CoreCacheAdapter) Set

func (a *CoreCacheAdapter) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

type CoreJobsAdapter

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

CoreJobsAdapter provides a capability-aware fallback/delegating core.Jobs adapter.

func NewCoreJobsAdapter

func NewCoreJobsAdapter(delegate core.Jobs, capabilities core.JobCapabilities) *CoreJobsAdapter

func NewCoreJobsAdapterFromConfig

func NewCoreJobsAdapterFromConfig(delegate core.Jobs, cfg *config.Config) (*CoreJobsAdapter, error)

func (*CoreJobsAdapter) Capabilities

func (a *CoreJobsAdapter) Capabilities() core.JobCapabilities

func (*CoreJobsAdapter) Enqueue

func (a *CoreJobsAdapter) Enqueue(ctx context.Context, name string, payload []byte, opts core.EnqueueOptions) (string, error)

func (*CoreJobsAdapter) Register

func (a *CoreJobsAdapter) Register(name string, handler core.JobHandler) error

func (*CoreJobsAdapter) StartScheduler

func (a *CoreJobsAdapter) StartScheduler(ctx context.Context) error

func (*CoreJobsAdapter) StartWorker

func (a *CoreJobsAdapter) StartWorker(context.Context) error

func (*CoreJobsAdapter) Stop

func (a *CoreJobsAdapter) Stop(ctx context.Context) error

type CoreJobsInspectorAdapter

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

func NewCoreJobsInspectorAdapter

func NewCoreJobsInspectorAdapter(delegate core.JobsInspector) *CoreJobsInspectorAdapter

func (*CoreJobsInspectorAdapter) Get

func (*CoreJobsInspectorAdapter) List

type CorePubSubAdapter

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

CorePubSubAdapter adapts repo-level pubsub client to the core.PubSub interface.

func NewCorePubSubAdapter

func NewCorePubSubAdapter(client pubsubrepo.PubSubClient) *CorePubSubAdapter

func (*CorePubSubAdapter) Close

func (a *CorePubSubAdapter) Close() error

func (*CorePubSubAdapter) Publish

func (a *CorePubSubAdapter) Publish(ctx context.Context, topic string, payload []byte) error

func (*CorePubSubAdapter) Subscribe

func (a *CorePubSubAdapter) Subscribe(ctx context.Context, topic string, handler core.MessageHandler) (core.Subscription, error)

type Registry

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

Registry stores known adapter names and capability metadata.

func NewDefaultRegistry

func NewDefaultRegistry() Registry

NewDefaultRegistry returns the canonical adapter registry for current GoShip runtime.

func (Registry) JobsCapabilities

func (r Registry) JobsCapabilities(name string) (core.JobCapabilities, bool)

JobsCapabilities returns the capability metadata for a jobs adapter.

func (Registry) ValidateRequirements

func (r Registry) ValidateRequirements(sel Selection, req Requirements) error

ValidateRequirements ensures selected adapters satisfy runtime capability needs.

func (Registry) ValidateSelection

func (r Registry) ValidateSelection(sel Selection) error

ValidateSelection ensures configured adapters are known.

type Requirements

type Requirements struct {
	Jobs core.JobCapabilities
}

Requirements describes capabilities required by runtime/process topology.

func RequirementsFromConfig

func RequirementsFromConfig(cfg *config.Config) Requirements

RequirementsFromConfig derives capability requirements from runtime/process topology.

type Resolved

type Resolved struct {
	Selection        Selection
	Requirements     Requirements
	JobsCapabilities core.JobCapabilities
}

Resolved contains normalized adapter information derived from config.

func ResolveFromConfig

func ResolveFromConfig(cfg *config.Config) (Resolved, error)

ResolveFromConfig validates adapter selection and capability requirements.

type Selection

type Selection struct {
	DB     string
	Cache  string
	Jobs   string
	PubSub string
}

Selection describes configured adapter names for runtime seams.

Jump to

Keyboard shortcuts

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