extension

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFARPRoutes

func ConvertFARPRoutes(serviceName string, farpRoutes []farpgw.ServiceRoute, prefix string, stripPrefix bool) []*bastion.Route

ConvertFARPRoutes converts FARP gateway client ServiceRoutes into bastion Routes.

func NewDiscoveryAdapter

func NewDiscoveryAdapter(svc *discovery.Service) bastion.DiscoveryService

NewDiscoveryAdapter creates a bastion.DiscoveryService from a discovery.Service. It is gateway.NewDiscoveryAdapter, kept here for existing callers.

func NewFARPDiscoveryAdapter

func NewFARPDiscoveryAdapter(disc farpdiscovery.ServiceDiscovery) bastion.DiscoveryService

NewFARPDiscoveryAdapter creates a bastion.DiscoveryService from a FARP ServiceDiscovery.

func WithDisableMigrate

func WithDisableMigrate() func(*Extension)

WithDisableMigrate disables auto-migration on startup.

func WithGroveDatabase

func WithGroveDatabase(name string) func(*Extension)

WithGroveDatabase configures the extension to use a named grove database from the DI container for persistent storage.

func WithStore

func WithStore(s store.Store) func(*Extension)

WithStore provides a pre-built store instance directly.

Types

type Extension

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

Extension wraps the Bastion gateway as a Forge extension, registering the bastion contract contributor that the React dashboard shell reads, auto-wiring the discovery service, and providing grove-based persistent store support.

The proxy and admin wiring is shared with the gateway package. Use that package directly when you don't need a grove store: it leaves the Mongo, Postgres and SQLite store packages out of your build.

func New

func New(opts ...bastion.ConfigOption) *Extension

New creates a Bastion Forge extension.

func (*Extension) Configure

func (e *Extension) Configure(opts ...func(*Extension)) *Extension

Configure applies extension-level options.

func (*Extension) Dependencies

func (e *Extension) Dependencies() []string

func (*Extension) Description

func (e *Extension) Description() string

func (*Extension) Gateway

func (e *Extension) Gateway() *bastion.Gateway

Gateway returns the underlying bastion.Gateway instance.

func (*Extension) Health

func (e *Extension) Health(ctx context.Context) error

func (*Extension) Name

func (e *Extension) Name() string

func (*Extension) Register

func (e *Extension) Register(app forge.App) error

func (*Extension) RegisterContractContributor

func (e *Extension) RegisterContractContributor(
	disp *dispatcher.Dispatcher,
	reg dashcontract.Registry,
	wreg dashcontract.WardenRegistry,
) error

RegisterContractContributor implements dashboard.ContractContributorAware. It registers the bastion contract contributor, which is what the React shell reads.

func (*Extension) Start

func (e *Extension) Start(ctx context.Context) error

func (*Extension) Stop

func (e *Extension) Stop(ctx context.Context) error

func (*Extension) Version

func (e *Extension) Version() string

type FARPDiscoveryAdapter

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

FARPDiscoveryAdapter wraps a FARP ServiceDiscovery to satisfy bastion's DiscoveryService interface. This enables bastion to use FARP's native discovery backends directly.

func (*FARPDiscoveryAdapter) DiscoverHealthy

func (a *FARPDiscoveryAdapter) DiscoverHealthy(ctx context.Context, serviceName string) ([]*bastion.ServiceInstanceInfo, error)

DiscoverHealthy returns healthy FARP instances as bastion ServiceInstanceInfo.

func (*FARPDiscoveryAdapter) ListServices

func (a *FARPDiscoveryAdapter) ListServices(ctx context.Context) ([]string, error)

ListServices lists all services via FARP's ListableDiscovery interface.

Directories

Path Synopsis
Package contract wires Bastion into the Forge dashboard's contract path.
Package contract wires Bastion into the Forge dashboard's contract path.

Jump to

Keyboard shortcuts

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