consul

package
v0.0.0-...-40ed724 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogService

type CatalogService struct {
	*Service
	Health string
}

type Consul

type Consul struct {
	Config  *Settings
	Client  *api.Client
	Catalog *api.Catalog
	Health  *api.Health
	Agent   *api.Agent
}

func New

func New(config *Settings) *Consul

func (*Consul) Connect

func (c *Consul) Connect() (*Consul, error)

func (*Consul) DeregisterService

func (c *Consul) DeregisterService(id string) error

func (*Consul) GetService

func (c *Consul) GetService(groupName, tag string) ([]*CatalogService, error)

func (*Consul) GetValidCheck

func (c *Consul) GetValidCheck(name, id string) (string, error)

func (*Consul) IsExists

func (c *Consul) IsExists(groupName, id string) (bool, error)

func (*Consul) RegisterService

func (c *Consul) RegisterService(settings *ServiceSettings) error

type Consuler

type Consuler interface {
	Connect() (*Consul, error)
	GetService(string, string) ([]*CatalogService, error)
	RegisterService(*ServiceSettings) error
	DeregisterService(string) error
	// contains filtered or unexported methods
}

type HKSettings

type HKSettings struct {
	Name            string
	HTTP            string
	Timeout         string
	Interval        string
	DeregisterAfter string
	SkipTLSVerify   bool
	Status          string // позволяет изначально инициализировать сервис живым
}

type Nodes

type Nodes struct {
	Capis    []*CatalogService
	Aapis    []*CatalogService
	Monitors []*CatalogService
}

type Service

type Service struct {
	ID      string
	Name    string
	Port    int
	Address string
	Tags    []string
	Meta    map[string]string
}

type ServiceSettings

type ServiceSettings struct {
	Service     *Service
	HealthCheck *HKSettings
}

type Settings

type Settings struct {
	Addresss      string
	Token         string
	DataCenter    string
	SkipTLSVerify bool
}

Jump to

Keyboard shortcuts

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