Documentation
¶
Index ¶
- func BuildGRPCService(serviceID, transport, address, version string) *mRegistry.Service
- func BuildHTTPService(serviceID, address string, version string) *mRegistry.Service
- func GetRegisterInterval() time.Duration
- func GetRegisterTTL() time.Duration
- func GetRegistry(opts ...Option) mRegistry.Registry
- func RegisterService(ctx context.Context, logger log.Logger, service *mRegistry.Service, ...) error
- type Config
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGRPCService ¶
func BuildHTTPService ¶
func GetRegisterInterval ¶
GetRegisterInterval returns the register interval from the environment.
func GetRegisterTTL ¶
GetRegisterTTL returns the register TTL from the environment.
func GetRegistry ¶
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