Documentation ¶
Index ¶
- Variables
- type Message
- type PullReq
- type Snapshot
- type Subscription
- type Tips
- func (ti *Tips) Ack(ctx context.Context, msgid string, topic string, subName string) (err error)
- func (ti *Tips) CreateSnapshots(ctx context.Context, SnapName string, subName string, topic string) (*Snapshot, error)
- func (ti *Tips) CreateTopic(ctx context.Context, topic string) (*Topic, error)
- func (ti *Tips) DeleteSnapshots(ctx context.Context, SnapName string, subName string, topic string) error
- func (ti *Tips) Destroy(ctx context.Context, topic string) error
- func (ti *Tips) GetSnapshot(ctx context.Context, SnapName string, subName string, topic string) (*Snapshot, error)
- func (ti *Tips) Publish(ctx context.Context, msg []string, topic string) ([]string, error)
- func (ti *Tips) Pull(ctx context.Context, req *PullReq) ([]*Message, error)
- func (ti *Tips) Seek(ctx context.Context, SnapName string, subName string, topic string) (*Subscription, error)
- func (ti *Tips) Subscribe(ctx context.Context, subName string, topic string) (*Subscription, error)
- func (ti *Tips) Topic(ctx context.Context, name string) (*Topic, error)
- func (ti *Tips) Unsubscribe(ctx context.Context, subName string, topic string) error
- type Topic
Constants ¶
This section is empty.
Variables ¶
var (
// ErrNotFound no found error
ErrNotFound = "%s can not found"
)
Functions ¶
This section is empty.
Types ¶
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 (*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 ¶
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) 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 ¶
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 ¶
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