consul

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*api.Client
	*Config
	// contains filtered or unexported fields
}

func ServiceRegister

func ServiceRegister(bindAddr string, cfg *Config) (*Client, error)

func (*Client) Close

func (c *Client) Close()

type Config

type Config struct {
	// service
	ConsulAddr  string   `json:"consul_addr"`
	ServiceName string   `json:"service_name"`
	Node        string   `json:"node"`
	Tags        []string `json:"tags"`

	// health
	Interval    string `json:"interval"`
	Timeout     string `json:"timeout"`
	ServiceIP   string `json:"service_ip"`
	ServicePort int    `json:"service_port"`
	// health check port range in [ min(HealthPort), max(HealthPort) ]
	HealthPort [2]int `json:"health_port"`
}

Jump to

Keyboard shortcuts

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