services

package
v0.0.0-...-97dd610 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SUBSCRIBE    *common.URL
	UrlIdsMapper sync.Map
)

Functions

func DestroySubscribe

func DestroySubscribe(registry registry.Registry)

func GetOverridePath

func GetOverridePath(key string) string

func GetRoutePath

func GetRoutePath(key string, routeType string) string

func GetRules

func GetRules(con string, ruleType string) (map[string]string, error)

func StartSubscribe

func StartSubscribe(registry registry.Registry)

Types

type ConsumerService

type ConsumerService interface {
	FindAll() ([]string, error)
	FindByService(string) ([]*model.Consumer, error)
}

type ConsumerServiceImpl

type ConsumerServiceImpl struct{}

func (*ConsumerServiceImpl) FindAll

func (c *ConsumerServiceImpl) FindAll() ([]string, error)

FindAll finds all consumers names

func (*ConsumerServiceImpl) FindByService

func (c *ConsumerServiceImpl) FindByService(service string) ([]*model.Consumer, error)

type MockRuleService

type MockRuleService interface {
	// create or update mock rule. if the request contains id, then will be an update operation.
	CreateOrUpdateMockRule(mockRule *model.MockRule) error

	// delete the mock rule data by mock rule id.
	DeleteMockRuleById(id int64) error

	// list the mock rules by filter and return data by page.
	ListMockRulesByPage(filter string, offset, limit int) ([]*model.MockRule, int64, error)

	// TODO getMockData method, which depends on the implementation corresponding to mock of dubbo-go.
	GetMockData(ctx context.Context, serviceName, methodName string) (rule string, enable bool, err error)
}

type MockRuleServiceImpl

type MockRuleServiceImpl struct {
	MockRuleMapper mapper.MockRuleMapper
	Logger         *zap.Logger
}

func (*MockRuleServiceImpl) CreateOrUpdateMockRule

func (m *MockRuleServiceImpl) CreateOrUpdateMockRule(mockRule *model.MockRule) error

func (*MockRuleServiceImpl) DeleteMockRuleById

func (m *MockRuleServiceImpl) DeleteMockRuleById(id int64) error

func (*MockRuleServiceImpl) GetMockData

func (m *MockRuleServiceImpl) GetMockData(ctx context.Context, serviceName, methodName string) (rule string, enable bool, err error)

func (*MockRuleServiceImpl) ListMockRulesByPage

func (m *MockRuleServiceImpl) ListMockRulesByPage(filter string, offset, limit int) ([]*model.MockRule, int64, error)

type MonitorService

type MonitorService interface {
	FlowMetrics() (model.FlowMetricsRes, error)                  // Traffic overview
	ClusterMetrics() (model.ClusterMetricsRes, error)            // Cluster overview
	PromDiscovery(w http.ResponseWriter) ([]model.Target, error) // prometheus http_sd discovery
	Metadata() (model.Metadata, error)
}

type OverrideService

type OverrideService interface {
	SaveOverride(override *model.DynamicConfig) error
	UpdateOverride(update *model.DynamicConfig) error
	DisableOverride(id string) error
	FindOverride(id string) (*model.DynamicConfig, error)
	EnableOverride(id string) error
	DeleteOverride(id string) error
}

type OverrideServiceImpl

type OverrideServiceImpl struct{}

func (*OverrideServiceImpl) DeleteOverride

func (s *OverrideServiceImpl) DeleteOverride(id string) error

func (*OverrideServiceImpl) DisableOverride

func (s *OverrideServiceImpl) DisableOverride(id string) error

func (*OverrideServiceImpl) EnableOverride

func (s *OverrideServiceImpl) EnableOverride(id string) error

func (*OverrideServiceImpl) FindOverride

func (s *OverrideServiceImpl) FindOverride(id string) (*model.DynamicConfig, error)

func (*OverrideServiceImpl) SaveOverride

func (s *OverrideServiceImpl) SaveOverride(dynamicConfig *model.DynamicConfig) error

func (*OverrideServiceImpl) UpdateOverride

func (s *OverrideServiceImpl) UpdateOverride(update *model.DynamicConfig) error

type PrometheusServiceImpl

type PrometheusServiceImpl struct{}

func (*PrometheusServiceImpl) ClusterMetrics

func (p *PrometheusServiceImpl) ClusterMetrics() (model.ClusterMetricsRes, error)

func (*PrometheusServiceImpl) FlowMetrics

func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error)

func (*PrometheusServiceImpl) Metadata

func (p *PrometheusServiceImpl) Metadata() (model.Metadata, error)

func (*PrometheusServiceImpl) PromDiscovery

func (p *PrometheusServiceImpl) PromDiscovery(w http.ResponseWriter) ([]model.Target, error)

type ProviderService

type ProviderService interface {
	FindServices() (*set.HashSet, error)
	FindApplications() (*set.HashSet, error)
	FindProtocols() (*set.HashSet, error)
	FindVersions() (*set.HashSet, error)
	FindService(string, string) ([]*model.ServiceDTO, error)
	FindByService(string) ([]*model.Provider, error)
}

type ProviderServiceImpl

type ProviderServiceImpl struct{}

func (*ProviderServiceImpl) FindApplications

func (p *ProviderServiceImpl) FindApplications() (*set.HashSet, error)

FindApplications finds all applications

func (*ProviderServiceImpl) FindByService

func (p *ProviderServiceImpl) FindByService(providerService string) ([]*model.Provider, error)

FindByService finds providers by service name and returns a list of providers

func (*ProviderServiceImpl) FindProtocols

func (p *ProviderServiceImpl) FindProtocols() (*set.HashSet, error)

FindProtocols finds all protocols

func (*ProviderServiceImpl) FindService

func (p *ProviderServiceImpl) FindService(pattern string, filter string) ([]*model.ServiceDTO, error)

FindService by patterns and filters, patterns support IP, service and application.

func (*ProviderServiceImpl) FindServices

func (p *ProviderServiceImpl) FindServices() (*set.HashSet, error)

FindServices finds all services

func (*ProviderServiceImpl) FindVersions

func (p *ProviderServiceImpl) FindVersions() (*set.HashSet, error)

FindVersions finds all versions

type RouteService

type RouteService interface {
	CreateTagRoute(model.TagRouteDto) error
	UpdateTagRoute(model.TagRouteDto) error
	DeleteTagRoute(string) error
	FindTagRoute(string) (model.TagRouteDto, error)
	EnableTagRoute(string) error
	DisableTagRoute(string) error

	CreateConditionRoute(model.ConditionRouteDto) error
	UpdateConditionRoute(model.ConditionRouteDto) error
	DeleteConditionRoute(string) error
	FindConditionRouteById(string) (model.ConditionRouteDto, error)
	FindConditionRoute(model.ConditionRouteDto) (model.ConditionRouteDto, error)
	EnableConditionRoute(string) error
	DisableConditionRoute(string) error
}

type RouteServiceImpl

type RouteServiceImpl struct{}

func (*RouteServiceImpl) CreateConditionRoute

func (t *RouteServiceImpl) CreateConditionRoute(conditionRouteDto model.ConditionRouteDto) error

func (*RouteServiceImpl) CreateTagRoute

func (t *RouteServiceImpl) CreateTagRoute(tagRoute model.TagRouteDto) error

func (*RouteServiceImpl) DeleteConditionRoute

func (t *RouteServiceImpl) DeleteConditionRoute(id string) error

func (*RouteServiceImpl) DeleteTagRoute

func (t *RouteServiceImpl) DeleteTagRoute(id string) error

func (*RouteServiceImpl) DisableConditionRoute

func (t *RouteServiceImpl) DisableConditionRoute(id string) error

func (*RouteServiceImpl) DisableTagRoute

func (t *RouteServiceImpl) DisableTagRoute(id string) error

func (*RouteServiceImpl) EnableConditionRoute

func (t *RouteServiceImpl) EnableConditionRoute(id string) error

func (*RouteServiceImpl) EnableTagRoute

func (t *RouteServiceImpl) EnableTagRoute(id string) error

func (*RouteServiceImpl) FindConditionRoute

func (t *RouteServiceImpl) FindConditionRoute(conditionRouteDto model.ConditionRouteDto) (model.ConditionRouteDto, error)

func (*RouteServiceImpl) FindConditionRouteById

func (t *RouteServiceImpl) FindConditionRouteById(id string) (model.ConditionRouteDto, error)

func (*RouteServiceImpl) FindTagRoute

func (t *RouteServiceImpl) FindTagRoute(id string) (model.TagRouteDto, error)

func (*RouteServiceImpl) UpdateConditionRoute

func (t *RouteServiceImpl) UpdateConditionRoute(conditionRouteDto model.ConditionRouteDto) error

func (*RouteServiceImpl) UpdateTagRoute

func (t *RouteServiceImpl) UpdateTagRoute(tagRoute model.TagRouteDto) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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