27 lines
358 B
Go
27 lines
358 B
Go
package x3_client
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/cookiejar"
|
|
)
|
|
|
|
type X3Client struct {
|
|
basePath string
|
|
|
|
httpClient *http.Client
|
|
}
|
|
|
|
func NewX3Client(basePath string) (*X3Client, error) {
|
|
jar, err := cookiejar.New(nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &X3Client{
|
|
basePath: basePath,
|
|
|
|
httpClient: &http.Client{
|
|
Jar: jar,
|
|
},
|
|
}, nil
|
|
}
|