service

package
v0.0.0-...-bae3b6f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotServiceInstances = errors.New("instances are not existed")

Functions

This section is empty.

Types

type DiscoveryServiceImpl

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

func (*DiscoveryServiceImpl) DiscoveryService

func (service *DiscoveryServiceImpl) DiscoveryService(ctx context.Context, serviceName string) ([]interface{}, error)

func (*DiscoveryServiceImpl) HealthCheck

func (*DiscoveryServiceImpl) HealthCheck() bool

HealthCheck implement Service method 用于检查服务的健康状态,这里仅仅返回true

func (*DiscoveryServiceImpl) SayHello

func (*DiscoveryServiceImpl) SayHello() string

type Service

type Service interface {

	// HealthCheck check service health status
	HealthCheck() bool

	// sayHelloService
	SayHello() string

	//  discovery service from consul by serviceName
	DiscoveryService(ctx context.Context, serviceName string) ([]interface{}, error)
}

func NewDiscoveryServiceImpl

func NewDiscoveryServiceImpl(discoveryClient discover.DiscoveryClient) Service

Jump to

Keyboard shortcuts

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