Skip to content

Commit

Permalink
proxy: add method to retrieve the client-config (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabor authored Feb 8, 2024
1 parent 0a80c8d commit d930fb9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions backend/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,17 @@ func (s *DataSourceInstanceSettings) ProxyOptions(clientCfg *proxy.ClientCfg) (*

return opts, nil
}

func (s *DataSourceInstanceSettings) ProxyClient(ctx context.Context) (proxy.Client, error) {
cfg := GrafanaConfigFromContext(ctx)
p, err := cfg.proxy()
if err != nil {
return nil, err
}
proxyOpts, err := s.ProxyOptions(p.clientCfg)
if err != nil {
return nil, err
}

return proxy.New(proxyOpts), nil
}

0 comments on commit d930fb9

Please sign in to comment.