name

package
v0.0.0-...-96417ad Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConsulAddr

func WithConsulAddr(addr string) func(n *ConsulName)

func WithConsulID

func WithConsulID(id string) func(n *ConsulName)

func WithConsulName

func WithConsulName(name string) func(n *ConsulName)

func WithConsulTags

func WithConsulTags(tag []string) func(n *ConsulName)

func WithGrpcHealthAddr

func WithGrpcHealthAddr(addr string) func(n *ConsulName)

func WithHTTPHealthUrl

func WithHTTPHealthUrl(url string) func(n *ConsulName)

func WithServiceAddr

func WithServiceAddr(addr string) func(n *ConsulName)

Types

type ConsulName

type ConsulName struct {
	ConsulAddr     string
	ServiceAddr    string
	HTTPHealthUrl  string
	GrpcHealthAddr string
	Name           string
	Id             string
	Tags           []string
}

func (*ConsulName) Reg

func (c *ConsulName) Reg() error

func (*ConsulName) ServiceList

func (c *ConsulName) ServiceList() (interface{}, error)

func (*ConsulName) ServicesWithFilter

func (c *ConsulName) ServicesWithFilter(filter string) (interface{}, error)

type ConsulOption

type ConsulOption func(n *ConsulName)

type Name

type Name interface {
	// 服务注册
	Reg() error
	// 服务列表
	ServiceList() (interface{}, error)
	// 获取某服务
	ServicesWithFilter(filter string) (interface{}, error)
}

func NewConsulName

func NewConsulName(opts ...ConsulOption) Name

Jump to

Keyboard shortcuts

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