connector

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_TIMEOUT_DURATION   = 10 * time.Second
	HTTP_KEEPALIVE_DURATION = 30 * time.Second

	USER_AGENT       = "swan/0.1"
	MESOS_STREAM_KEY = "swan/0.1"
)

Variables

View Source
var SPECIAL_CHARACTER = regexp.MustCompile("([\\-\\.\\$\\*\\+\\?\\{\\}\\(\\)\\[\\]\\|]+)")

Functions

func Init

func Init(user string, mesosZkPath *url.URL)

func NewReader

func NewReader(r io.Reader) io.Reader

NewReader returns an io.Reader that unpacks the data read from r out of RecordIO framing before returning it.

Types

type Connector

type Connector struct {
	MesosZkPath           *url.URL
	ClusterID             string
	MesosLeader           string
	MesosLeaderHttpClient *HttpClient

	EventChan chan *event.MesosEvent
	ErrorChan chan error

	FrameworkInfo *mesos.FrameworkInfo

	StreamCtx       context.Context
	StreamCancelFun context.CancelFunc
}

Connector create a persistent connection against mesos master to subscribe mesos event. caller could use: MesosEvent() to subscribe mesos events ErrEvent() to subscribe connnector's failures SendCall() to emit request against mesos master

func Instance

func Instance() *Connector

func (*Connector) ErrEvent

func (s *Connector) ErrEvent() chan error

func (*Connector) MesosEvent

func (s *Connector) MesosEvent() chan *event.MesosEvent

func (*Connector) Reregister

func (s *Connector) Reregister() error

func (*Connector) SendCall

func (s *Connector) SendCall(call *sched.Call)

func (*Connector) SetFrameworkInfoId

func (s *Connector) SetFrameworkInfoId(id string)

func (*Connector) Start

func (s *Connector) Start(ctx context.Context)

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(addr, path string) *HttpClient

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL