backend

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package backend is the seam between the local provider and what actually serves a resource in a development session.

The provider knows which resource kinds a session has to serve itself and which it hands to the platform's provider. What serves them is a separate decision: today a queue and a topic are Redis, because that is what the runtime's consumer side reads locally, and nothing about the provider assumes it. A backend package registers what it can build when it is linked, and the provider asks here rather than importing it.

The same arrangement as the AWS module's internal/service, for the same two reasons: a session whose blueprint declares no queue does not link a Redis client for one, and a backend that is not Redis can be added without the provider learning about it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterQueue

func RegisterQueue(b Builder[queue.Client])

RegisterQueue is called by a backend package that can serve a local queue.

func RegisterReleaser

func RegisterReleaser(release func(context.Context) error)

RegisterReleaser is called by a backend package that holds a connection worth giving back when the session stops.

func RegisterTopic

func RegisterTopic(b Builder[topic.Client])

RegisterTopic is called by a backend package that can serve a local topic.

func Release

func Release(ctx context.Context) error

Release gives back what the linked backends hold.

Every releaser is called even when an earlier one fails: shutdown is the one time carrying on matters more than the error.

Types

type Builder

type Builder[T any] func(resources.Ref) (T, error)

Builder makes a client for one resource, named by the reference a handle carries.

func Queues

func Queues() (Builder[queue.Client], error)

Queues returns the builder a backend registered.

func Topics

func Topics() (Builder[topic.Client], error)

Topics returns the builder a backend registered.

Jump to

Keyboard shortcuts

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