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 ¶
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 ¶
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 (*Registry) Get ¶
func (r *Registry) Get(name string) (RegisterFunc, bool)
Get retrieves a service registration function by name
func (*Registry) LoadAll ¶
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
Click to show internal directories.
Click to hide internal directories.