servicediscovery

package
v0.0.0-...-f011ba4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestDeadTime

func GetRequestDeadTime(req *http.Request) int

Types

type Address

type Address struct {
	Ip   string
	Port int
}

type ServiceCenter

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

func (*ServiceCenter) Address

func (sc *ServiceCenter) Address(serviceName string) *Address

func (*ServiceCenter) ClientName

func (sc *ServiceCenter) ClientName(req *http.Request) string

func (*ServiceCenter) Register

func (sc *ServiceCenter) Register(name string, ip string, port int) chan bool

type ServiceCenterBuilder

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

func Create

func Create() *ServiceCenterBuilder

func (*ServiceCenterBuilder) AddressFunc

func (b *ServiceCenterBuilder) AddressFunc(f func(serviceName string) *Address) *ServiceCenterBuilder

func (*ServiceCenterBuilder) Build

func (b *ServiceCenterBuilder) Build() *ServiceCenter

func (*ServiceCenterBuilder) ClientNameFunc

func (b *ServiceCenterBuilder) ClientNameFunc(f func(req *http.Request) string) *ServiceCenterBuilder

func (*ServiceCenterBuilder) RegisterFunc

func (b *ServiceCenterBuilder) RegisterFunc(f func(name string, ip string, port int) chan bool) *ServiceCenterBuilder

type ServiceQuery

type ServiceQuery interface {
	Get(name string) *Address

	ClientName(req *http.Request) string
}

Jump to

Keyboard shortcuts

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