tips

package module
v0.0.0-...-b4d2924 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

Tips

A distributed Pub/Sub system based on TiKV

Go Report Card Build Status Coverage Status GoDoc

Roadmap

milestones

Features

  • High performance, high availability, horizontal scaling
  • Massive Topics support and massive data support for single Topic
  • Topic kept in a global order
  • At-Least-Once reliable communication
  • Support concurrent consumers (like, Kafka Consumer Group)
  • Snapshot and recovery of subscription state

Scenarios

  • Asynchronous task processing (e.g. pictures/ videos)
  • Event-driven framework (e.g. microservice/Severless )
  • Multi-to-multi message communication (e.g. IM/ group chat in live-broadcasting room with large scale )
  • Notifications push on mobile devices

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound no found error
	ErrNotFound = "%s can not found"
)

Functions

This section is empty.

Types

type Message

type Message struct {
	Payload []byte
	ID      string
}

Message is an encapsulation of message information

type PullReq

type PullReq struct {
	SubName string
	Topic   string
	Limit   int64
	AutoACK bool
	Offset  string
}

PullReq is a structure which encapsulates the pull request information

type Snapshot

type Snapshot struct {
	pubsub.Snapshot
}

Snapshot is a structure which encapsulates the Snapshot of pubsub instance

type Subscription

type Subscription struct {
	pubsub.Subscription
}

Subscription is a structure which encapsulates the Subscription of pubsub instance

type Tips

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

Tips is a structure which encapsulates a pubsub instance

func MockTips

func MockTips() (*Tips, error)

MockTips returns a mock tips object

func NewTips

func NewTips(path string) (tips *Tips, err error)

NewTips returns a tips object

func (*Tips) Ack

func (ti *Tips) Ack(ctx context.Context, msgid string, topic string, subName string) (err error)

Ack acknowledges a message

func (*Tips) CreateSnapshots

func (ti *Tips) CreateSnapshots(ctx context.Context, SnapName string, subName string, topic string) (*Snapshot, error)

CreateSnapshots creates a snapshot of a specified subscription Return the create snapshots Objcet

func (*Tips) CreateTopic

func (ti *Tips) CreateTopic(ctx context.Context, topic string) (*Topic, error)

CreateTopic creates a Topic object

func (*Tips) DeleteSnapshots

func (ti *Tips) DeleteSnapshots(ctx context.Context, SnapName string, subName string, topic string) error

DeleteSnapshots delete a snapshot Object

func (*Tips) Destroy

func (ti *Tips) Destroy(ctx context.Context, topic string) error

Destroy destorys an instance of a topic

func (*Tips) GetSnapshot

func (ti *Tips) GetSnapshot(ctx context.Context, SnapName string, subName string, topic string) (*Snapshot, error)

GetSnapshot gets the specified snapshot instance

func (*Tips) Publish

func (ti *Tips) Publish(ctx context.Context, msg []string, topic string) ([]string, error)

Publish publish messages in a single or batch manner.Return msgids if succeed. The topic and msgs which are the input parameters shouldn't be empty Note that the messages returned should be in the same order as the messages to be published.

func (*Tips) Pull

func (ti *Tips) Pull(ctx context.Context, req *PullReq) ([]*Message, error)

Pull pulls messages of a specified topic according to the pull request Returns messages required by the pull request.

func (*Tips) Seek

func (ti *Tips) Seek(ctx context.Context, SnapName string, subName string, topic string) (*Subscription, error)

Seek seek a specified snapshot

func (*Tips) Subscribe

func (ti *Tips) Subscribe(ctx context.Context, subName string, topic string) (*Subscription, error)

Subscribe associates a topic with a subscription.

func (*Tips) Topic

func (ti *Tips) Topic(ctx context.Context, name string) (*Topic, error)

Topic returns a topic queried by name

func (*Tips) Unsubscribe

func (ti *Tips) Unsubscribe(ctx context.Context, subName string, topic string) error

Unsubscribe unsubscribes a topic and delete the subscription

type Topic

type Topic struct {
	pubsub.Topic
}

Topic is a structure which encapsulates the Topic of pubsub instance

Directories

Path Synopsis
store

Jump to

Keyboard shortcuts

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