sds

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSdsClientNotInit = errors.New("sds client not init")
View Source
var SubscriberRetryPeriod = 3 * time.Second

Functions

func CloseSdsClient

func CloseSdsClient()

func NewSdsClientSingleton

func NewSdsClientSingleton(cfg interface{}) types.SdsClient

TODO: support sds client index instead of singleton

func RegisterSdsStreamClientFactory added in v0.25.0

func RegisterSdsStreamClientFactory(f func(config interface{}) (SdsStreamClient, error))

func SetSdsPostCallback

func SetSdsPostCallback(fc func())

SetPostCallback

Types

type SdsClientImpl

type SdsClientImpl struct {
	SdsCallbackMap map[string]types.SdsUpdateCallbackFunc
	// contains filtered or unexported fields
}

func (*SdsClientImpl) AddUpdateCallback

func (client *SdsClientImpl) AddUpdateCallback(name string, callback types.SdsUpdateCallbackFunc) error

func (*SdsClientImpl) DeleteUpdateCallback

func (client *SdsClientImpl) DeleteUpdateCallback(name string) error

DeleteUpdateCallback

func (*SdsClientImpl) SetSecret

func (client *SdsClientImpl) SetSecret(name string, secret *types.SdsSecret)

SetSecret invoked when sds subscriber get secret response

type SdsStreamClient

type SdsStreamClient interface {
	// Send creates a secret discovery request with name, and send it to server
	Send(name string) error
	// Recv receive a secret discovert response, handle it and send a ack response
	Recv(provider types.SecretProvider, callback func()) error
	// Stop stops a stream client
	Stop()
}

func GetSdsStreamClient added in v0.25.0

func GetSdsStreamClient(config interface{}) (SdsStreamClient, error)

type SdsSubscriber

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

func NewSdsSubscriber

func NewSdsSubscriber(provider types.SecretProvider, sdsConfig interface{}) *SdsSubscriber

func (*SdsSubscriber) SendSdsRequest

func (subscribe *SdsSubscriber) SendSdsRequest(name string)

func (*SdsSubscriber) Start

func (subscribe *SdsSubscriber) Start()

func (*SdsSubscriber) Stop

func (subscribe *SdsSubscriber) Stop()

Jump to

Keyboard shortcuts

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