service_oauth_authentication.go
func serviceOAuth(certFilePath string) (*serviceOAuthAuthentication, error) {
	// First we read the cert
	certs := x509.NewCertPool()
	pemData, err := ioutil.ReadFile(certFilePath)
	if err != nil {
		return nil, err
	}
	certs.AppendCertsFromPEM(pemData)
	mTLSConfig := &tls.Config{
		RootCAs: certs, //Add the cert as a TLS config
	}
	a := serviceOAuthAuthentication{
		BaseUrl: "https://coinbase.com/",
		Client: http.Client{
			Transport: &http.Transport{
				Dial:            dialTimeout,
				TLSClientConfig: mTLSConfig,
			},
		},
	}
	return &a, nil
}
func serviceOAuth(certFilePath string) (*serviceOAuthAuthentication, error) {
	// First we read the cert
	certs := x509.NewCertPool()
	pemData, err := ioutil.ReadFile(certFilePath)
	if err != nil {
		return nil, err
	}
	certs.AppendCertsFromPEM(pemData)
	mTLSConfig := &tls.Config{
		RootCAs: certs, //Add the cert as a TLS config
	}
	a := serviceOAuthAuthentication{
		BaseUrl: "https://coinbase.com/",
		Client: http.Client{
			Transport: &http.Transport{
				Dial:            dialTimeout,
				TLSClientConfig: mTLSConfig,
			},
		},
	}
	return &a, nil
}
func serviceOAuth ( certFilePath string ) ( * serviceOAuthAuthentication , error ) { // First we read the cert certs := x509 . NewCertPool ( ) pemData , err := ioutil . ReadFile ( certFilePath ) if err != nil { return nil , err } certs . AppendCertsFromPEM ( pemData ) mTLSConfig := & tls . Config { RootCAs : certs , //Add the cert as a TLS config } a := serviceOAuthAuthentication { BaseUrl : " " , Client : http . Client { Transport : & http . Transport { Dial : dialTimeout , TLSClientConfig : mTLSConfig , } , } , } return & a , nil }
// ServiceOAuth instantiates ServiceOAuthAuthentication with the coinbase certificate file
ServiceOAuth instantiates ServiceOAuthAuthentication with the coinbase certificate file