Documentation
¶
Index ¶
- func ConvertFARPRoutes(serviceName string, farpRoutes []farpgw.ServiceRoute, prefix string, ...) []*bastion.Route
- func NewDiscoveryAdapter(svc *discovery.Service) bastion.DiscoveryService
- func NewFARPDiscoveryAdapter(disc farpdiscovery.ServiceDiscovery) bastion.DiscoveryService
- func WithDisableMigrate() func(*Extension)
- func WithGroveDatabase(name string) func(*Extension)
- func WithStore(s store.Store) func(*Extension)
- type Extension
- func (e *Extension) Configure(opts ...func(*Extension)) *Extension
- func (e *Extension) Dependencies() []string
- func (e *Extension) Description() string
- func (e *Extension) Gateway() *bastion.Gateway
- func (e *Extension) Health(ctx context.Context) error
- func (e *Extension) Name() string
- func (e *Extension) Register(app forge.App) error
- func (e *Extension) RegisterContractContributor(disp *dispatcher.Dispatcher, reg dashcontract.Registry, ...) error
- func (e *Extension) Start(ctx context.Context) error
- func (e *Extension) Stop(ctx context.Context) error
- func (e *Extension) Version() string
- type FARPDiscoveryAdapter
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 ¶
WithGroveDatabase configures the extension to use a named grove database from the DI container for persistent storage.
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 (*Extension) Dependencies ¶
func (*Extension) Description ¶
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.
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.