registry

package
v1.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 17 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGRPCService

func BuildGRPCService(serviceID, transport, address, version string) *mRegistry.Service

func BuildHTTPService

func BuildHTTPService(serviceID, address string, version string) *mRegistry.Service

func GetRegisterInterval

func GetRegisterInterval() time.Duration

GetRegisterInterval returns the register interval from the environment.

func GetRegisterTTL

func GetRegisterTTL() time.Duration

GetRegisterTTL returns the register TTL from the environment.

func GetRegistry

func GetRegistry(opts ...Option) mRegistry.Registry

GetRegistry returns a configured micro registry based on Micro env vars. It defaults to mDNS, so mind that systems with mDNS disabled by default (i.e SUSE) will have a hard time and it needs to explicitly use etcd. Os awareness for providing a working registry out of the box should be done.

func RegisterService

func RegisterService(ctx context.Context, logger log.Logger, service *mRegistry.Service, debugAddr string) error

RegisterService publishes an arbitrary endpoint to the service-registry. This allows querying nodes of non-micro services like reva. No health-checks are done, thus the caller is responsible for canceling.

Types

type Config

type Config struct {
	Type         string        `mapstructure:"type"`
	Addresses    []string      `mapstructure:"addresses"`
	Username     string        `mapstructure:"username"`
	Password     string        `mapstructure:"password"`
	DisableCache bool          `mapstructure:"disable_cache"`
	RegisterTTL  time.Duration `mapstructure:"register_ttl"`
}

Config is the config for a registry

type Option

type Option func(*Config)

Option allows configuring the registry

func Inmemory

func Inmemory() Option

Inmemory overrides env values to use an in-memory registry

Jump to

Keyboard shortcuts

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