This commit is contained in:
Sivaram Mothiki 2017-03-09 19:39:29 +00:00 committed by GitHub
commit 8fbc0c76e5

View file

@ -17,13 +17,14 @@ package realis
import (
"encoding/base64"
"net/http"
"net/http/cookiejar"
"time"
"git.apache.org/thrift.git/lib/go/thrift"
"github.com/pkg/errors"
"github.com/rdelval/gorealis/gen-go/apache/aurora"
"github.com/rdelval/gorealis/response"
"net/http"
"net/http/cookiejar"
"time"
)
type Realis interface {
@ -62,6 +63,16 @@ func NewClient(config RealisConfig) Realis {
client: aurora.NewAuroraSchedulerManagerClientFactory(config.transport, config.protoFactory)}
}
// Create a new ReadOnlyClient with a default transport layer
func NewReadOnlyClient(config RealisConfig) *aurora.ReadOnlySchedulerClient {
return aurora.NewReadOnlySchedulerClientFactory(config.transport, config.protoFactory)
}
func CloseReadONlyClient(r *aurora.ReadOnlySchedulerClient) {
r.Transport.Close()
}
// Creates a default Thrift Transport object for communications in gorealis using an HTTP Post Client
func defaultTTransport(urlstr string, timeoutms int) (thrift.TTransport, error) {
jar, err := cookiejar.New(nil)