discover

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConsulAddress

func GetConsulAddress() string

func IsInsideDockerContainer

func IsInsideDockerContainer() bool

func SetConsulFinderToDefault

func SetConsulFinderToDefault()

Types

type Client

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

func GetConsulClient

func GetConsulClient() *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) GetAddress

func (c *Client) GetAddress(service string) string

func (*Client) GetAddressWithTag

func (c *Client) GetAddressWithTag(service string, tag string) string

func (*Client) GetAllAddress

func (c *Client) GetAllAddress(service string) []string

func (*Client) GetAllAddressWithTag

func (c *Client) GetAllAddressWithTag(service string, tag string) []string

func (*Client) RegisterService

func (c *Client) RegisterService(serviceName string, address string) error

func (*Client) RegisterServiceWithTag

func (c *Client) RegisterServiceWithTag(serviceName string, address string, tag string) error

func (*Client) RegisterServiceWithTags

func (c *Client) RegisterServiceWithTags(serviceName string, address string, tags []string) error

type DirectFinder

type DirectFinder struct{}

func NewDirectFinder

func NewDirectFinder() *DirectFinder

func (*DirectFinder) Close

func (df *DirectFinder) Close()

func (*DirectFinder) GetAddress

func (df *DirectFinder) GetAddress(service string) string

func (*DirectFinder) GetAddressWithTag

func (df *DirectFinder) GetAddressWithTag(service string, tag string) string

func (*DirectFinder) GetAllAddress

func (df *DirectFinder) GetAllAddress(service string) []string

func (*DirectFinder) GetAllAddressWithTag

func (df *DirectFinder) GetAllAddressWithTag(service string, tag string) []string

func (*DirectFinder) RegisterService

func (df *DirectFinder) RegisterService(service string, address string) error

func (*DirectFinder) RegisterServiceWithTag

func (df *DirectFinder) RegisterServiceWithTag(service string, address string, tag string) error

func (*DirectFinder) RegisterServiceWithTags

func (df *DirectFinder) RegisterServiceWithTags(service string, address string, tags []string) error

type RegisteredService

type RegisteredService struct {
	ServiceID string
	CheckID   string
}

type Service

type Service struct {
	ServiceName string
	Address     string
	Tags        []string
}

type ServiceFinder

type ServiceFinder interface {
	GetAddress(service string) string
	GetAllAddress(service string) []string
	GetAddressWithTag(service, tag string) string
	GetAllAddressWithTag(service, tag string) []string

	RegisterService(service, address string) error
	RegisterServiceWithTag(service, address, tag string) error
	RegisterServiceWithTags(service, address string, tags []string) error
	Close()
}

func GetConsulServiceFinder

func GetConsulServiceFinder() ServiceFinder

func GetServiceFinder

func GetServiceFinder() ServiceFinder

Jump to

Keyboard shortcuts

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