loader

package
v2.1.93 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLoadConcurrency is the default number of concurrent service loads
	DefaultLoadConcurrency = 10
)

Variables

View Source
var (
	// DefaultRegistry is the global service registry
	DefaultRegistry = NewRegistry()
)

Functions

func LoadAll

func LoadAll(router *api.Router)

LoadAll is a convenience function to load all services from the default registry concurrently

func Register

func Register(name string, registerFunc RegisterFunc)

Register is a convenience function to register a service with the default registry

Types

type RegisterFunc

type RegisterFunc func(router *api.Router)

RegisterFunc is a function that registers a service with the router

type Registry

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

Registry holds all registeredServices services

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new service registry

func (*Registry) Get

func (r *Registry) Get(name string) (RegisterFunc, bool)

Get retrieves a service registration function by name

func (*Registry) List

func (r *Registry) List() []string

List returns all registeredServices service names

func (*Registry) LoadAll

func (r *Registry) LoadAll(router *api.Router)

LoadAll loads all registeredServices services into the router concurrently with a configurable concurrency limit via LOAD_CONCURRENCY env var (default: 10)

func (*Registry) Register

func (r *Registry) Register(name string, registerFunc RegisterFunc)

Register adds a service to the registry This should be called from init() functions in service packages

Jump to

Keyboard shortcuts

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