-
Notifications
You must be signed in to change notification settings - Fork 4
/
client.go
45 lines (37 loc) · 1.2 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package client
import (
"io"
"github.com/iwarapter/pingfederate-sdk-go/pingfederate/client/metadata"
"github.com/iwarapter/pingfederate-sdk-go/pingfederate/config"
"github.com/iwarapter/pingfederate-sdk-go/pingfederate/request"
)
type Options struct {
Config config.Config
CustomCABundle io.Reader
}
// ConfigProvider provides a generic way for a service client to receive
// the ClientConfig without circular dependencies.
type ConfigProvider interface {
ClientConfig(serviceName string, cfgs ...*config.Config) config.Config
}
// A Client implements the base client request and response handling
// used by all service clients.
type PfClient struct {
//request.Retryer
metadata.ClientInfo
Config config.Config
//Handlers request.Handlers
}
func New(cfg config.Config, info metadata.ClientInfo) *PfClient {
svc := &PfClient{
Config: cfg,
ClientInfo: info,
//Handlers: handlers.Copy(),
}
return svc
}
// NewRequest returns a new Request pointer for the service API
// operation and parameters.
func (c *PfClient) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request {
return request.New(c.Config, c.ClientInfo, operation, params, data)
}