controller/src/x3-client/client.go

28 lines
361 B
Go
Raw Normal View History

2024-10-10 15:05:46 +00:00
package x3_client
import (
"net/http"
"net/http/cookiejar"
)
type X3Client struct {
Host string
httpClient *http.Client
}
func NewX3Client(host, port string) (*X3Client, error) {
jar, err := cookiejar.New(nil)
if err != nil {
return nil, err
}
return &X3Client{
Host: host + ":" + port,
httpClient: &http.Client{
Jar: jar,
},
}, nil
}