Versions in this module Expand all Collapse all v1 v1.2.0 Apr 12, 2026 Changes in this version + type DiscoveryEvent struct + Instance ServiceInstance + Manifest *farp.SchemaManifest + Timestamp time.Time + Type farp.EventType + type DiscoveryEventHandler func(event DiscoveryEvent) + type FARPHandler struct + func NewFARPHandler(manifest *farp.SchemaManifest, schemas map[farp.SchemaType]any) *FARPHandler + func (h *FARPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *FARPHandler) SetHealth(status farp.InstanceStatus) + func (h *FARPHandler) UpdateManifest(manifest *farp.SchemaManifest) + func (h *FARPHandler) UpdateSchema(schemaType farp.SchemaType, schema any) + type GatewayNode struct + func NewGatewayNode(config GatewayNodeConfig) (*GatewayNode, error) + func (n *GatewayNode) GatewayClient() *gateway.Client + func (n *GatewayNode) ListServiceNames() []string + func (n *GatewayNode) PushHandler() http.Handler + func (n *GatewayNode) Registry() farp.SchemaRegistry + func (n *GatewayNode) Routes() []gateway.ServiceRoute + func (n *GatewayNode) Services() map[string]*farp.SchemaManifest + func (n *GatewayNode) Start(ctx context.Context) error + func (n *GatewayNode) Stop(_ context.Context) error + type GatewayNodeConfig struct + Discovery ServiceDiscovery + EnablePush bool + Fetcher ManifestFetcher + HTTPClient *http.Client + HealthPollInterval time.Duration + HeartbeatTimeout time.Duration + OnRoutesChanged func(routes []gateway.ServiceRoute) + OnServiceEvent func(event DiscoveryEvent) + Registry farp.SchemaRegistry + RouteHandler farp.RouteUpdateHandler + ServiceNames []string + type HTTPManifestFetcher struct + func NewHTTPManifestFetcher(client *http.Client) *HTTPManifestFetcher + func (f *HTTPManifestFetcher) FetchManifest(_ context.Context, instance ServiceInstance) (*farp.SchemaManifest, error) + type ListableDiscovery interface + ListServices func(ctx context.Context) ([]string, error) + type ManifestFetcher interface + FetchManifest func(ctx context.Context, instance ServiceInstance) (*farp.SchemaManifest, error) + type NamedDiscovery interface + Initialize func(ctx context.Context) error + Name func() string + type PushDiscovery struct + func NewPushDiscovery(gatewayURL string, client *http.Client) *PushDiscovery + func (p *PushDiscovery) Close() error + func (p *PushDiscovery) Deregister(ctx context.Context, instanceID string) error + func (p *PushDiscovery) Discover(ctx context.Context, serviceName string) ([]ServiceInstance, error) + func (p *PushDiscovery) Health(ctx context.Context) error + func (p *PushDiscovery) Register(ctx context.Context, instance ServiceInstance) error + func (p *PushDiscovery) RegisterWithManifest(ctx context.Context, instance ServiceInstance, manifest *farp.SchemaManifest) (*PushRegistrationResponse, error) + func (p *PushDiscovery) ReportHealth(ctx context.Context, instanceID string, status farp.InstanceStatus) error + func (p *PushDiscovery) ReportHealthWithChecksum(ctx context.Context, instanceID string, status farp.InstanceStatus, ...) (*PushHeartbeatResponse, error) + func (p *PushDiscovery) Watch(ctx context.Context, _ string, _ DiscoveryEventHandler) error + type PushHandler struct + func NewPushHandler(heartbeatTimeout time.Duration) *PushHandler + func (h *PushHandler) Close() error + func (h *PushHandler) Deregister(_ context.Context, instanceID string) error + func (h *PushHandler) Discover(_ context.Context, serviceName string) ([]ServiceInstance, error) + func (h *PushHandler) Health(_ context.Context) error + func (h *PushHandler) Register(_ context.Context, instance ServiceInstance) error + func (h *PushHandler) ReportHealth(_ context.Context, instanceID string, status farp.InstanceStatus) error + func (h *PushHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *PushHandler) Watch(ctx context.Context, _ string, handler DiscoveryEventHandler) error + type PushHeartbeat struct + RoutesChecksum string + Status farp.InstanceStatus + type PushHeartbeatResponse struct + RoutesChecksum string + SchemasApplied int + Status string + type PushRegistration struct + Instance ServiceInstance + Manifest *farp.SchemaManifest + type PushRegistrationResponse struct + RoutesChecksum string + SchemasApplied int + Status string + type ServiceDiscovery interface + Close func() error + Deregister func(ctx context.Context, instanceID string) error + Discover func(ctx context.Context, serviceName string) ([]ServiceInstance, error) + Health func(ctx context.Context) error + Register func(ctx context.Context, instance ServiceInstance) error + ReportHealth func(ctx context.Context, instanceID string, status farp.InstanceStatus) error + Watch func(ctx context.Context, serviceName string, handler DiscoveryEventHandler) error + type ServiceInstance struct + Address string + ID string + LastHealthCheck time.Time + Metadata map[string]string + Port int + RegisteredAt time.Time + ServiceName string + Status farp.InstanceStatus + Tags []string + Version string + type ServiceNode struct + func NewServiceNode(config ServiceNodeConfig) (*ServiceNode, error) + func (n *ServiceNode) HTTPHandler() http.Handler + func (n *ServiceNode) Manifest() *farp.SchemaManifest + func (n *ServiceNode) Start(ctx context.Context) error + func (n *ServiceNode) Stop(ctx context.Context) error + func (n *ServiceNode) UpdateSchema(ctx context.Context) error + type ServiceNodeConfig struct + Address string + BasePath string + Discovery ServiceDiscovery + Endpoints farp.SchemaEndpoints + GatewayURL string + HTTPClient *http.Client + HealthInterval time.Duration + Hints *farp.ServiceHints + InstanceID string + MaxRetries int + Metadata map[string]string + MountStrategy farp.MountStrategy + PathRules []farp.PathRule + Providers []farp.SchemaProvider + Registry farp.SchemaRegistry + RetryBackoff time.Duration + Routes any + ServiceName string + ServiceVersion string + TTL time.Duration + Tags []string + type TagDiscovery interface + DiscoverWithTags func(ctx context.Context, serviceName string, tags []string) ([]ServiceInstance, error)