client

package
v0.0.0-...-3e9cf14 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpPusher

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

func NewHttpPusher

func NewHttpPusher(serverAddr, callbackAddr string) *HttpPusher

callbackAddr 服务器地址,callbackAddr 回调地址 同时会监听回调地址以实现Listener功能

func (*HttpPusher) Add

func (p *HttpPusher) Add(topic string, timeout int64, data []byte) (err error)

func (*HttpPusher) Delete

func (p *HttpPusher) Delete(topic string, data []byte) (err error)

func (*HttpPusher) DeleteThenAdd

func (p *HttpPusher) DeleteThenAdd(topic string, timeout int64, data []byte) (err error)

type HttpReceiver

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

func NewHttpReceiver

func NewHttpReceiver(listenAddr string) *HttpReceiver

在startServer后会监听listenAddr地址

func (*HttpReceiver) AddListener

func (p *HttpReceiver) AddListener(topic string, listener Listener)

func (*HttpReceiver) Commit

func (p *HttpReceiver) Commit(topic string, data []byte) (err error)

func (*HttpReceiver) HandleRequest

func (p *HttpReceiver) HandleRequest(req *http.Request) (response string)

处理来自的async-runner的http回调请求 最后直接响应response就行了

func (*HttpReceiver) StartServer

func (p *HttpReceiver) StartServer() (err error)

开启阻塞服务

type Listener

type Listener func(body []byte) error

Jump to

Keyboard shortcuts

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