consul

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package consul implements onexmesh registry.Registrar and registry.Discovery backed by HashiCorp Consul (github.com/hashicorp/consul/api).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(opts Options) (registry.Discovery, error)

NewDiscovery creates a Consul Discovery.

func NewRegistrar

func NewRegistrar(opts Options) (registry.Registrar, error)

NewRegistrar creates a Consul Registrar.

Types

type Options

type Options struct {
	// Addr is the Consul agent address, e.g. "127.0.0.1:8500".
	Addr string
	// Scheme is the URI scheme of the Consul agent, "http" or "https".
	Scheme string
	// Token is the Consul ACL token, if required.
	Token string
	// Datacenter selects the Consul datacenter.
	Datacenter string
	// Namespace is the Consul Enterprise namespace.
	Namespace string
	// TTL is the service check TTL; the registrar heartbeats at half this
	// interval. Default 15s.
	TTL time.Duration
	// Host is the local instance host used for registration.
	Host string
	// Port is the local instance port used for registration.
	Port int
	// Protocol is the service protocol, e.g. "grpc" or "http".
	Protocol string
}

Options configures the Consul backend.

Jump to

Keyboard shortcuts

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