consul

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName = "consul"
)

Variables

This section is empty.

Functions

func NewSubscriber

create a new subscriber

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf *ConsulConfig) (*Client, error)

func (*Client) Consul

func (c *Client) Consul() *consulapi.Client

type ConsulConfig

type ConsulConfig struct {
	WatchType     string `yaml:"watch_type" json:"watch_type" mapstructure:"watch_type"`
	Datacenter    string `yaml:"datacenter" json:"datacenter" mapstructure:"datacenter"`
	Address       string `yaml:"address" json:"address" mapstructure:"address"`
	Scheme        string `yaml:"scheme" json:"scheme" mapstructure:"scheme"`
	HttpAuth      string `yaml:"http_auth" json:"http_auth" mapstructure:"http_auth"`
	Token         string `yaml:"token" json:"token" mapstructure:"token"`
	CAFile        string `yaml:"ca_file" json:"ca_file" mapstructure:"ca_file"`
	CAPem         string `yaml:"ca_pem" json:"ca_pem" mapstructure:"ca_pem"`
	CertFile      string `yaml:"cert_file" json:"cert_file" mapstructure:"cert_file"`
	CertPEM       string `yaml:"cert_pem" json:"cert_pem" mapstructure:"cert_pem"`
	KeyFile       string `yaml:"key_file" json:"key_file" mapstructure:"key_file"`
	KeyPEM        string `yaml:"key_pem" json:"key_pem" mapstructure:"key_pem"`
	CAPath        string `yaml:"ca_path" json:"ca_path" mapstructure:"ca_path"`
	InsecureHttps bool   `yaml:"insecure_https" json:"insecure_https" mapstructure:"insecure_https"`
	Namespace     string `yaml:"namespace" json:"namespace" mapstructure:"namespace"`
}

func (*ConsulConfig) Client

func (c *ConsulConfig) Client() (*consulapi.Client, error)

Client returns a new client for accessing consul.

type Subscriber

type Subscriber struct {
	// contains filtered or unexported fields
}

Subscriber implements the subscriber interface for consul

func (*Subscriber) Connect

func (s *Subscriber) Connect(ctx context.Context) (err error)

Connect connects to nats server

func (*Subscriber) Disconnect

func (s *Subscriber) Disconnect(ctx context.Context) (err error)

Disconnect disconnect from nats server

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context) (err error)

Subscribe to bundle updates

func (*Subscriber) Unsubscribe

func (s *Subscriber) Unsubscribe(ctx context.Context) (err error)

unsubscribe from bundle updates

Jump to

Keyboard shortcuts

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