backend

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// the same as v3rpc.MaxOpsPerTxn = 128
	MaxTxnNumberOneTime = 128
)

Variables

View Source
var (
	DOMAIN          discovery.Type
	PROJECT         discovery.Type
	SERVICE         discovery.Type
	ServiceIndex    discovery.Type
	ServiceAlias    discovery.Type
	ServiceTag      discovery.Type
	RULE            discovery.Type
	RuleIndex       discovery.Type
	DependencyRule  discovery.Type
	DependencyQueue discovery.Type
	SCHEMA          discovery.Type
	SchemaSummary   discovery.Type
	INSTANCE        discovery.Type
	LEASE           discovery.Type
)

Functions

func BatchCommit

func BatchCommit(ctx context.Context, opts []registry.PluginOp) error

func BatchCommitWithCmp

func BatchCommitWithCmp(ctx context.Context, opts []registry.PluginOp,
	cmp []registry.CompareOp, fail []registry.PluginOp) (resp *registry.PluginResponse, err error)

func Registry

func Registry() registry.Registry

func ReportHeartbeatCompleted

func ReportHeartbeatCompleted(err error, start time.Time)

func ReportScInstance

func ReportScInstance()

func Revision

func Revision() int64

func ToLeaseAsyncTaskKey

func ToLeaseAsyncTaskKey(key string) string

Types

type AddOn

type AddOn interface {
	Name() string
	Config() *discovery.Config
}

func NewAddOn

func NewAddOn(name string, cfg *discovery.Config) AddOn

type InstanceEventDeferHandler

type InstanceEventDeferHandler struct {
	Percent float64
	// contains filtered or unexported fields
}

func NewInstanceEventDeferHandler

func NewInstanceEventDeferHandler() *InstanceEventDeferHandler

func (*InstanceEventDeferHandler) HandleChan

func (iedh *InstanceEventDeferHandler) HandleChan() <-chan discovery.KvEvent

func (*InstanceEventDeferHandler) OnCondition

func (iedh *InstanceEventDeferHandler) OnCondition(cache discovery.CacheReader, evts []discovery.KvEvent) bool

func (*InstanceEventDeferHandler) Reset

func (iedh *InstanceEventDeferHandler) Reset() bool

type KvStore

type KvStore struct {
	AddOns map[discovery.Type]AddOn
	// contains filtered or unexported fields
}

func Store

func Store() *KvStore

func (*KvStore) Adaptors

func (s *KvStore) Adaptors(id discovery.Type) discovery.Adaptor

func (*KvStore) DependencyQueue

func (s *KvStore) DependencyQueue() discovery.Adaptor

func (*KvStore) DependencyRule

func (s *KvStore) DependencyRule() discovery.Adaptor

func (*KvStore) Domain

func (s *KvStore) Domain() discovery.Adaptor

func (*KvStore) Initialize

func (s *KvStore) Initialize()

func (*KvStore) InjectConfig

func (s *KvStore) InjectConfig(cfg *discovery.Config) *discovery.Config

func (*KvStore) Install

func (s *KvStore) Install(addOn AddOn) (id discovery.Type, err error)

func (*KvStore) Instance

func (s *KvStore) Instance() discovery.Adaptor

func (*KvStore) KeepAlive

func (s *KvStore) KeepAlive(ctx context.Context, opts ...registry.PluginOpOption) (int64, error)

KeepAlive will always return ok when registry is unavailable unless the registry response is LeaseNotFound

func (*KvStore) Lease

func (s *KvStore) Lease() discovery.Adaptor

func (*KvStore) MustInstall

func (s *KvStore) MustInstall(addOn AddOn) discovery.Type

func (*KvStore) OnCacheEvent

func (s *KvStore) OnCacheEvent(evt discovery.KvEvent)

func (*KvStore) Project

func (s *KvStore) Project() discovery.Adaptor

func (*KvStore) Ready

func (s *KvStore) Ready() <-chan struct{}

func (*KvStore) Rule

func (s *KvStore) Rule() discovery.Adaptor

func (*KvStore) RuleIndex

func (s *KvStore) RuleIndex() discovery.Adaptor

func (*KvStore) Run

func (s *KvStore) Run()

func (*KvStore) Schema

func (s *KvStore) Schema() discovery.Adaptor

func (*KvStore) SchemaSummary

func (s *KvStore) SchemaSummary() discovery.Adaptor

func (*KvStore) Service

func (s *KvStore) Service() discovery.Adaptor

func (*KvStore) ServiceAlias

func (s *KvStore) ServiceAlias() discovery.Adaptor

func (*KvStore) ServiceIndex

func (s *KvStore) ServiceIndex() discovery.Adaptor

func (*KvStore) ServiceTag

func (s *KvStore) ServiceTag() discovery.Adaptor

func (*KvStore) Stop

func (s *KvStore) Stop()

type LeaseTask

type LeaseTask struct {
	Client registry.Registry

	LeaseID int64
	TTL     int64
	// contains filtered or unexported fields
}

func NewLeaseAsyncTask

func NewLeaseAsyncTask(op registry.PluginOp) *LeaseTask

func (*LeaseTask) Do

func (lat *LeaseTask) Do(ctx context.Context) (err error)

func (*LeaseTask) Err

func (lat *LeaseTask) Err() error

func (*LeaseTask) Key

func (lat *LeaseTask) Key() string

func (*LeaseTask) ReceiveTime

func (lat *LeaseTask) ReceiveTime() time.Time

type RegistryEngine

type RegistryEngine struct {
	registry.Registry
	// contains filtered or unexported fields
}

func GetRegistryEngine

func GetRegistryEngine() *RegistryEngine

func NewEngine

func NewEngine() (*RegistryEngine, error)

func (*RegistryEngine) Start

func (s *RegistryEngine) Start() error

func (*RegistryEngine) Stop

func (s *RegistryEngine) Stop()

Jump to

Keyboard shortcuts

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