ServiceUtils

package
v0.0.0-...-d15be54 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Scheme = "wcenter"

Variables

This section is empty.

Functions

func Load

func Load(projectRoot string) error

Types

type EtcdValue

type EtcdValue struct {
	Op       int                       `json:"Op"`
	Addr     string                    `json:"Addr"`
	Metadata *MetricManage.MetricsData `json:"Metadata"`
}

type MetricManageSvc

type MetricManageSvc struct {
	ServiceManageEndpoints []string `toml:"endpoints"`
	MetricManageIpAddr     string   `toml:"ipaddr"`
	MetricManagePort       string   `toml:"port"`
}

type MongoConf

type MongoConf struct {
	Username string `toml:"username"`
	Password string `toml:"password"`
	Ipaddr   string `toml:"ipaddr"`
	Port     string `toml:"port"`
}

type RedisConf

type RedisConf struct {
	Ipaddr string `toml:"ipaddr"`
	Port   string `toml:"port"`
}

type ServiceBuilder

type ServiceBuilder struct{}

func (*ServiceBuilder) Build

func (*ServiceBuilder) Scheme

func (*ServiceBuilder) Scheme() string

type ServiceUtils

type ServiceUtils interface {
	//TODO implement 用户调用 服务注册
	RegisterService(ctx context.Context, service *ServiceManage.Service) error
	//TODO implement 用户调用 服务续约
	RenewService(ctx context.Context, leaseId clientv3.LeaseID)
}

type ServiceUtilsImpl

type ServiceUtilsImpl struct {
	MetricMonitor MetricMonitor.MetricMonitor
	EtcdClient    *clientv3.Client
	RedisClient   *redis.Client
	MongoClient   *mongo.Client
	// contains filtered or unexported fields
}

func NewServiceUtils

func NewServiceUtils() (*ServiceUtilsImpl, error)

func (*ServiceUtilsImpl) Close

func (s *ServiceUtilsImpl) Close()

func (*ServiceUtilsImpl) FetchOptimalServiceMetricsForPrefix

func (s *ServiceUtilsImpl) FetchOptimalServiceMetricsForPrefix(ctx context.Context, ProjectName, ServiceName string) (*MetricManage.ServiceInstance, error)

func (*ServiceUtilsImpl) RegisterService

func (s *ServiceUtilsImpl) RegisterService(ctx context.Context, service *ServiceManage.Service) error

TODO implement 用户调用 服务注册

func (*ServiceUtilsImpl) RenewService

func (s *ServiceUtilsImpl) RenewService(ctx context.Context, leaseId clientv3.LeaseID)

TODO implement 用户调用 服务续约 TODO implement 使用消息队列订阅服务注销的主题,监听到后应不再续约

func (*ServiceUtilsImpl) ResolveNow

func (s *ServiceUtilsImpl) ResolveNow(opts resolver.ResolveNowOptions)

func (*ServiceUtilsImpl) UnRegisterService

func (s *ServiceUtilsImpl) UnRegisterService(cancelFunc context.CancelFunc, ServiceUnRegister *redis.PubSub, service *ServiceManage.Service)

Jump to

Keyboard shortcuts

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