consul

package
v0.0.0-...-bbf0bf7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TTL time to life for service in consul
	TTL int = 15
	// Where the ServiceKVPath resides
	ServicesKVpath string = "services"
	// Where the JobsKVPath resides
	JobsKVPath string = "ingestion-jobs"
	// Where the TablesKVPath resides
	TablesKVPath string = "tables"
	// Config falls back to client default config
	ConsulConfig *api.Config = api.DefaultConfig()
)

Functions

This section is empty.

Types

type Consul

type Consul struct {
	// Agent to register service
	Agent *api.Agent
	// KV to save service definition
	KV *api.KV
	// contains filtered or unexported fields
}

Consul structure

func New

func New() *Consul

New Consul

func (*Consul) Declare

func (c *Consul) Declare(s service.Service) error

Send service definition to consul

func (*Consul) GetIngestionJobConfiguration

func (c *Consul) GetIngestionJobConfiguration(id string) (*cingestion.IngestionJobConfiguration, error)

Retrieve the consul ingestion job configuration

func (*Consul) GetIngestionJobStatus

func (c *Consul) GetIngestionJobStatus(id string) (cingestion.JobStatus, error)

Retrieve the consul ingestion job status

func (*Consul) GetService

func (c *Consul) GetService(s service.Service) error

Retrieve the consul service definition

func (*Consul) GetTableConfiguration

func (c *Consul) GetTableConfiguration(name string) (*entities.Table, error)

Retrieve the consul table configuration

func (*Consul) Heartbeat

func (c *Consul) Heartbeat(s service.Service)

Heartbeat begins heart beat of health check.

func (*Consul) Init

func (c *Consul) Init() error

Init Consul with Default Settings

func (*Consul) PutIngestionJobConfiguration

func (c *Consul) PutIngestionJobConfiguration(config *cingestion.IngestionJobConfiguration) error

Store the consul ingestion job configuration

func (*Consul) PutIngestionJobStatus

func (c *Consul) PutIngestionJobStatus(id string, status cingestion.JobStatus) error

Store the consul ingestion job status

func (*Consul) PutTableConfiguration

func (c *Consul) PutTableConfiguration(table *entities.Table) error

Store the consul table configuration

func (*Consul) Start

func (c *Consul) Start(s service.Service) error

Start Register the service in the consul pool of services

func (*Consul) Stop

func (c *Consul) Stop(s service.Service) error

Kill the heartbeat and remove the service

Jump to

Keyboard shortcuts

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