12345678910111213141516171819202122232425262728 |
- package dapr_client
- var clientInstance *Client
- var clientTimeoutSec int64
- func InitDAPR(timeoutSec int64) {
- clientTimeoutSec = timeoutSec
- }
- func DestroyDAPR() {
- if clientInstance != nil {
- destroyClient(clientInstance)
- clientInstance = nil
- }
- }
- func GetInstance() *Client {
- if clientInstance == nil {
- client, err := newClient(clientTimeoutSec)
- if err != nil {
- return nil
- }
- clientInstance = client
- }
- return clientInstance
- }
|