bns

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLocalNameConf

func LoadLocalNameConf(filename string) error

LoadLocalNameConf loads name conf file

Types

type Client

type Client struct {
}

func NewClient

func NewClient() *Client

func (*Client) GetInstancesAddr

func (c *Client) GetInstancesAddr(serviceName string) ([]string, error)

GetInstancesAddr return instance addr info of serviceName

func (*Client) GetInstancesInfo

func (c *Client) GetInstancesInfo(serviceName string) ([]Instance, error)

GetInstancesInfo returns instance addr and weight info of serviceName

type Instance

type Instance struct {
	Host   string // instance host
	Port   int    // instance port
	Weight int    // instance weight
}

Instance represents instance info

type LocalNameConf

type LocalNameConf map[string][]Instance

type NameConf

type NameConf struct {
	Version string
	Config  LocalNameConf
}

Jump to

Keyboard shortcuts

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