queue

package
v0.0.0-...-d8a2fef Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: BSD-3-Clause Imports: 16 Imported by: 4

Documentation

Overview

Package queue is a generated protocol buffer package.

It is generated from these files:

uq.proto

It has these top-level messages:

UnitedQueueStore
UnitedTopicStore
InflightMessage
UnitedLineStore

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthUq = fmt.Errorf("proto: negative length found during unmarshaling")
)

Functions

This section is empty.

Types

type FakeQueue

type FakeQueue struct{}

FakeQueue is a fake queue in uq

func NewFakeQueue

func NewFakeQueue(storage store.Storage, ip string, port int, etcdServers []string, etcdKey string) (*FakeQueue, error)

NewFakeQueue returns a new FakeQueue

func (*FakeQueue) Close

func (f *FakeQueue) Close()

Close implements Close interface

func (*FakeQueue) Confirm

func (f *FakeQueue) Confirm(key string) error

Confirm implements Confirm interface

func (*FakeQueue) Create

func (f *FakeQueue) Create(key, recycle string) error

Create implements Create interface

func (*FakeQueue) Empty

func (f *FakeQueue) Empty(key string) error

Empty implements Empty interface

func (*FakeQueue) MultiConfirm

func (f *FakeQueue) MultiConfirm(keys []string) []error

MultiConfirm implements MultiConfirm interface

func (*FakeQueue) MultiPop

func (f *FakeQueue) MultiPop(key string, n int) ([]string, [][]byte, error)

MultiPop implements MultiPop interface

func (*FakeQueue) MultiPush

func (f *FakeQueue) MultiPush(key string, datas [][]byte) error

MultiPush implements MultiPush interface

func (*FakeQueue) Pop

func (f *FakeQueue) Pop(key string) (string, []byte, error)

Pop implements Pop interface

func (*FakeQueue) Push

func (f *FakeQueue) Push(key string, data []byte) error

Push implements Push interface

func (*FakeQueue) Remove

func (f *FakeQueue) Remove(key string) error

Remove implements Remove interface

func (*FakeQueue) Stat

func (f *FakeQueue) Stat(key string) (*Stat, error)

Stat implements Stat interface

type InflightMessage

type InflightMessage struct {
	Tid              uint64 `protobuf:"varint,1,req" json:"Tid"`
	Exptime          int64  `protobuf:"varint,2,req" json:"Exptime"`
	XXX_unrecognized []byte `json:"-"`
}

func (*InflightMessage) Marshal

func (m *InflightMessage) Marshal() (data []byte, err error)

func (*InflightMessage) MarshalTo

func (m *InflightMessage) MarshalTo(data []byte) (int, error)

func (*InflightMessage) ProtoMessage

func (*InflightMessage) ProtoMessage()

func (*InflightMessage) Reset

func (m *InflightMessage) Reset()

func (*InflightMessage) Size

func (m *InflightMessage) Size() (n int)

func (*InflightMessage) String

func (m *InflightMessage) String() string

func (*InflightMessage) Unmarshal

func (m *InflightMessage) Unmarshal(data []byte) error

type MessageQueue

type MessageQueue interface {
	// queue functions
	Push(key string, data []byte) error
	MultiPush(key string, datas [][]byte) error
	Pop(key string) (string, []byte, error)
	MultiPop(key string, n int) ([]string, [][]byte, error)
	Confirm(key string) error
	MultiConfirm(keys []string) []error
	// admin functions
	Create(key, recycle string) error
	Empty(key string) error
	Remove(key string) error
	Stat(key string) (*Stat, error)
	Close()
}

MessageQueue is the message queue interface of uq

type Stat

type Stat struct {
	Name    string  `json:"name"`
	Type    string  `json:"type"`
	Lines   []*Stat `json:"lines,omitempty"`
	Recycle string  `json:"recycle,omitempty"`
	Head    uint64  `json:"head"`
	IHead   uint64  `json:"ihead"`
	Tail    uint64  `json:"tail"`
	Count   uint64  `json:"count"`
}

Stat is the Stat of a UnitedQueue

func (*Stat) ToJSON

func (q *Stat) ToJSON() ([]byte, error)

ToJSON returns the json string of Stat

func (*Stat) ToMcString

func (q *Stat) ToMcString() string

ToMcString returns the memcached string of Stat

func (*Stat) ToRedisStrings

func (q *Stat) ToRedisStrings() []string

ToRedisStrings returns the redis strings of Stat

func (*Stat) ToString

func (q *Stat) ToString() string

ToString returns the string of Stat

func (*Stat) ToStrings

func (q *Stat) ToStrings() []string

ToStrings returns the strings of Stat

type UnitedLineStore

type UnitedLineStore struct {
	Head             uint64             `protobuf:"varint,1,req" json:"Head"`
	Ihead            uint64             `protobuf:"varint,2,req" json:"Ihead"`
	Inflights        []*InflightMessage `protobuf:"bytes,3,rep" json:"Inflights,omitempty"`
	XXX_unrecognized []byte             `json:"-"`
}

func (*UnitedLineStore) Marshal

func (m *UnitedLineStore) Marshal() (data []byte, err error)

func (*UnitedLineStore) MarshalTo

func (m *UnitedLineStore) MarshalTo(data []byte) (int, error)

func (*UnitedLineStore) ProtoMessage

func (*UnitedLineStore) ProtoMessage()

func (*UnitedLineStore) Reset

func (m *UnitedLineStore) Reset()

func (*UnitedLineStore) Size

func (m *UnitedLineStore) Size() (n int)

func (*UnitedLineStore) String

func (m *UnitedLineStore) String() string

func (*UnitedLineStore) Unmarshal

func (m *UnitedLineStore) Unmarshal(data []byte) error

type UnitedQueue

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

UnitedQueue is a implemention of message queue in uq

func NewUnitedQueue

func NewUnitedQueue(storage store.Storage, ip string, port int, etcdServers []string, etcdKey string) (*UnitedQueue, error)

NewUnitedQueue returns a new UnitedQueue

func (*UnitedQueue) Close

func (u *UnitedQueue) Close()

Close implements Close interface

func (*UnitedQueue) Confirm

func (u *UnitedQueue) Confirm(key string) error

Confirm implements Confirm interface

func (*UnitedQueue) Create

func (u *UnitedQueue) Create(key, arg string) error

Create implements Create interface

func (*UnitedQueue) Empty

func (u *UnitedQueue) Empty(key string) error

Empty implements Empty interface

func (*UnitedQueue) MultiConfirm

func (u *UnitedQueue) MultiConfirm(keys []string) []error

MultiConfirm implements MultiConfirm interface

func (*UnitedQueue) MultiPop

func (u *UnitedQueue) MultiPop(key string, n int) ([]string, [][]byte, error)

MultiPop implements MultiPop interface

func (*UnitedQueue) MultiPush

func (u *UnitedQueue) MultiPush(key string, datas [][]byte) error

MultiPush implements MultiPush interface

func (*UnitedQueue) Pop

func (u *UnitedQueue) Pop(key string) (string, []byte, error)

Pop implements Pop interface

func (*UnitedQueue) Push

func (u *UnitedQueue) Push(key string, data []byte) error

Push implements Push interface

func (*UnitedQueue) Remove

func (u *UnitedQueue) Remove(key string) error

Remove implements Remove interface

func (*UnitedQueue) Stat

func (u *UnitedQueue) Stat(key string) (*Stat, error)

Stat implements Stat interface

type UnitedQueueStore

type UnitedQueueStore struct {
	Topics           []string `protobuf:"bytes,1,rep" json:"Topics,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*UnitedQueueStore) Marshal

func (m *UnitedQueueStore) Marshal() (data []byte, err error)

func (*UnitedQueueStore) MarshalTo

func (m *UnitedQueueStore) MarshalTo(data []byte) (int, error)

func (*UnitedQueueStore) ProtoMessage

func (*UnitedQueueStore) ProtoMessage()

func (*UnitedQueueStore) Reset

func (m *UnitedQueueStore) Reset()

func (*UnitedQueueStore) Size

func (m *UnitedQueueStore) Size() (n int)

func (*UnitedQueueStore) String

func (m *UnitedQueueStore) String() string

func (*UnitedQueueStore) Unmarshal

func (m *UnitedQueueStore) Unmarshal(data []byte) error

type UnitedTopicStore

type UnitedTopicStore struct {
	Lines            []string `protobuf:"bytes,1,rep" json:"Lines,omitempty"`
	Persist          bool     `protobuf:"varint,2,req" json:"Persist"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*UnitedTopicStore) Marshal

func (m *UnitedTopicStore) Marshal() (data []byte, err error)

func (*UnitedTopicStore) MarshalTo

func (m *UnitedTopicStore) MarshalTo(data []byte) (int, error)

func (*UnitedTopicStore) ProtoMessage

func (*UnitedTopicStore) ProtoMessage()

func (*UnitedTopicStore) Reset

func (m *UnitedTopicStore) Reset()

func (*UnitedTopicStore) Size

func (m *UnitedTopicStore) Size() (n int)

func (*UnitedTopicStore) String

func (m *UnitedTopicStore) String() string

func (*UnitedTopicStore) Unmarshal

func (m *UnitedTopicStore) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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