v0.2.4 Latest Latest

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

Go to latest
Published: Mar 16, 2017 License: Apache-2.0 Imports: 9 Imported by: 0




This section is empty.


This section is empty.


func CheckHealth added in v0.2.2

func CheckHealth(url string) (bool, error)

func CreateMemberName added in v0.2.0

func CreateMemberName(clusterName string, member int) string

func GetCounterFromMemberName added in v0.2.0

func GetCounterFromMemberName(name string) (int, error)

func ListMembers added in v0.2.0

func ListMembers(endpoints []string) (*clientv3.MemberListResponse, error)

func MemberNameFromPeerURL added in v0.2.0

func MemberNameFromPeerURL(pu string) (string, error)

func RemoveMember added in v0.2.0

func RemoveMember(clientURLs []string, id uint64) error


type Member

type Member struct {
	Name string
	// ID field can be 0, which is unknown ID.
	// We know the ID of a member when we get the member information from etcd,
	// but not from Kubernetes pod list.
	ID uint64

	// PeerURLs is only used for self-hosted setup.
	PeerURLs []string
	// ClientURLs is only used for self-hosted setup.
	ClientURLs []string

func (*Member) ClientAddr

func (m *Member) ClientAddr() string

func (*Member) PeerAddr

func (m *Member) PeerAddr() string

type MemberSet

type MemberSet map[string]*Member

func NewMemberSet

func NewMemberSet(ms ...*Member) MemberSet

func (MemberSet) Add

func (ms MemberSet) Add(m *Member)

func (MemberSet) ClientURLs

func (ms MemberSet) ClientURLs() []string

func (MemberSet) Diff

func (ms MemberSet) Diff(other MemberSet) MemberSet

the set of all members of s1 that are not members of s2

func (MemberSet) IsEqual added in v0.2.0

func (ms MemberSet) IsEqual(other MemberSet) bool

IsEqual tells whether two member sets are equal by checking - they have the same set of members and member equality are judged by Name only.

func (MemberSet) PeerURLPairs

func (ms MemberSet) PeerURLPairs() []string

func (MemberSet) PickOne

func (ms MemberSet) PickOne() *Member

func (MemberSet) Remove

func (ms MemberSet) Remove(name string)

func (MemberSet) Size

func (ms MemberSet) Size() int

func (MemberSet) String

func (ms MemberSet) String() string

Jump to

Keyboard shortcuts

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