Versions in this module Expand all Collapse all v0 v0.0.2 Jul 12, 2021 Changes in this version + var CONSUL_DISCOVER = "consul" + var ConfValidErr = errors.New("conf valid error") + var DIRECT_DISCOVER = "direct" + var NodeNotFoundErr = errors.New("node not found error") + var RequestErr = errors.New("request error") + var ServiceNotFoundErr = errors.New("service not found error") + type Client struct + Conf Conf + Discover Discover + func NewClient(conf Conf) *Client + func (c *Client) CallWithHeader(path string, method string, params map[string]string, jsonParams interface{}, ...) ([]byte, error) + type Conf struct + Debug bool + Discover string + Host string + Proxy string + ServiceName string + type ConsulDiscover struct + func (d *ConsulDiscover) Endpoint() (string, error) + func (d *ConsulDiscover) GetService() error + type DirectDiscover struct + func (d *DirectDiscover) Endpoint() (string, error) + type Discover interface + Endpoint func() (string, error) + func MustNewDiscover(conf Conf) Discover + func NewConsulDiscover(conf Conf) (Discover, error) + func NewDirectDiscover(conf Conf) (Discover, error) + func NewDiscover(conf Conf) (Discover, error) + type Publisher struct + func NewPublisher(consulHost string, consulKey string, listenOn string, listenPort int, ...) *Publisher + func (p *Publisher) Register() error + func (p *Publisher) Revoke() + type PublisherOption func(client *Publisher)