mocli

package
v0.0.0-...-e8d26fd Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCTimeout = 10 * time.Second

	RefreshInterval = 15 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSet

type ClientSet struct {
	Client     logservice.ProxyHAKeeperClient
	StoreCache *StoreCache

	LockServiceClient *LockServiceClient
}

func (*ClientSet) Close

func (h *ClientSet) Close() error

type LockServiceClient

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

func NewLockServiceClient

func NewLockServiceClient(tnAddr string, logger *zap.Logger) (*LockServiceClient, error)

func (*LockServiceClient) CanRestartCN

func (l *LockServiceClient) CanRestartCN(ctx context.Context, uuid string) (bool, error)

func (*LockServiceClient) Close

func (l *LockServiceClient) Close() error

func (*LockServiceClient) RemainTxnCount

func (l *LockServiceClient) RemainTxnCount(ctx context.Context, uuid string) (int, error)

func (*LockServiceClient) SetRestartCN

func (l *LockServiceClient) SetRestartCN(ctx context.Context, uuid string) (bool, error)

type MORPCClientManager

type MORPCClientManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewManager

func NewManager(kubeCli client.Client, logger *zap.Logger) *MORPCClientManager

func (*MORPCClientManager) Close

func (m *MORPCClientManager) Close()

func (*MORPCClientManager) GetClient

func (m *MORPCClientManager) GetClient(ls *v1alpha1.LogSet) (*ClientSet, error)

type StoreCache

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

func NewCNCache

func NewCNCache(
	client logservice.ProxyHAKeeperClient,
	refreshInterval time.Duration,
	logger logr.Logger) *StoreCache

func (*StoreCache) Close

func (c *StoreCache) Close()

func (*StoreCache) GetCN

func (c *StoreCache) GetCN(uuid string) (metadata.CNService, bool)

func (*StoreCache) GetTN

func (c *StoreCache) GetTN() (*metadata.TNService, bool)

Jump to

Keyboard shortcuts

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