Merge 28a6cbdea9
into 51699eda4e
This commit is contained in:
commit
8fbc0c76e5
1 changed files with 14 additions and 3 deletions
17
realis.go
17
realis.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue