Documentation ¶
Index ¶
- Variables
- func CloseSdsClient()
- func NewSdsClientSingleton(cfg interface{}) types.SdsClient
- func RegisterSdsStreamClientFactory(f func(config interface{}) (SdsStreamClient, error))
- func SetSdsPostCallback(fc func())
- type SdsClientImpl
- func (client *SdsClientImpl) AckResponse(resp interface{})
- func (client *SdsClientImpl) AddUpdateCallback(name string, callback types.SdsUpdateCallbackFunc) error
- func (client *SdsClientImpl) DeleteUpdateCallback(name string) error
- func (client *SdsClientImpl) FetchSecret(ctx context.Context, name string) (*types.SdsSecret, error)
- func (client *SdsClientImpl) RequireSecret(name string)
- func (client *SdsClientImpl) SetSecret(name string, secret *types.SdsSecret)
- type SdsStreamClient
- type SdsSubscriber
- func (subscribe *SdsSubscriber) FetchSdsSecret(ctx context.Context, name string) (*types.SdsSecret, error)
- func (subscribe *SdsSubscriber) SendAck(resp interface{})
- func (subscribe *SdsSubscriber) SendSdsRequest(name string)
- func (subscribe *SdsSubscriber) Start()
- func (subscribe *SdsSubscriber) Stop()
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 ¶
TODO: support sds client index instead of singleton
func RegisterSdsStreamClientFactory ¶ added in v0.25.0
func RegisterSdsStreamClientFactory(f func(config interface{}) (SdsStreamClient, error))
Types ¶
type SdsClientImpl ¶
type SdsClientImpl struct { SdsCallbackMap map[string]types.SdsUpdateCallbackFunc // contains filtered or unexported fields }
func (*SdsClientImpl) AckResponse ¶ added in v0.27.0
func (client *SdsClientImpl) AckResponse(resp interface{})
AckResponse invoked when sds subscriber receive a response
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) FetchSecret ¶ added in v0.27.0
func (*SdsClientImpl) RequireSecret ¶ added in v0.27.0
func (client *SdsClientImpl) RequireSecret(name string)
type SdsStreamClient ¶
type SdsStreamClient interface { // Send creates a secret discovery request with name, and send it to server Send(name string) error // Recv receives a secret discovery response, handle it and send an ack response Recv(provider types.SecretProvider, callback func()) error // Fetch creates a secret discovery request with name, and wait the response Fetch(ctx context.Context, name string) (*types.SdsSecret, error) // AckResponse creates an ack request based on the response AckResponse(resp interface{}) // 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) FetchSdsSecret ¶ added in v0.27.0
func (*SdsSubscriber) SendAck ¶ added in v0.27.0
func (subscribe *SdsSubscriber) SendAck(resp interface{})
func (*SdsSubscriber) SendSdsRequest ¶
func (subscribe *SdsSubscriber) SendSdsRequest(name string)
func (*SdsSubscriber) Start ¶
func (subscribe *SdsSubscriber) Start()
func (*SdsSubscriber) Stop ¶
func (subscribe *SdsSubscriber) Stop()
Click to show internal directories.
Click to hide internal directories.