connector

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 25 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 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 {
	ClusterID             string
	MesosLeader           string
	MesosLeaderHttpClient *HttpClient

	SendChan    chan *sched.Call
	ReceiveChan chan *event.MesosEvent

	FrameworkInfo *mesos.FrameworkInfo

	StreamCtx       context.Context
	StreamCancelFun context.CancelFunc
	// contains filtered or unexported fields
}

func Instance

func Instance() *Connector

func NewConnector

func NewConnector() *Connector

func (*Connector) LeaderDetect

func (s *Connector) LeaderDetect() error

func (*Connector) Reregister

func (s *Connector) Reregister() error

func (*Connector) Send

func (s *Connector) Send(call *sched.Call) (*http.Response, error)

func (*Connector) SetFrameworkInfoId

func (s *Connector) SetFrameworkInfoId(id string)

func (*Connector) Start

func (s *Connector) Start(ctx context.Context, errorChan chan error)

func (*Connector) Subscribe

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

type HttpClient

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

func NewHTTPClient

func NewHTTPClient(addr, path string) *HttpClient

func (*HttpClient) Send

func (c *HttpClient) Send(payload []byte) (*http.Response, error)

Jump to

Keyboard shortcuts

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