(client admin_client.Client, resource string)
| 17 | var _ gateway.IDynamicClient = &DynamicClient{} |
| 18 | |
| 19 | func NewDynamicClient(client admin_client.Client, resource string) (*DynamicClient, error) { |
| 20 | cfg, has := gateway.GetDynamicResourceDriver(resource) |
| 21 | if !has { |
| 22 | return nil, errors.New("resource not found") |
| 23 | } |
| 24 | |
| 25 | return &DynamicClient{client: client, profession: cfg.Profession, driver: cfg.Driver}, nil |
| 26 | } |
| 27 | |
| 28 | type DynamicClient struct { |
| 29 | profession string |
no test coverage detected