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 ¶
- Variables
- type FakeQueue
- func (f *FakeQueue) Close()
- func (f *FakeQueue) Confirm(key string) error
- func (f *FakeQueue) Create(key, recycle string) error
- func (f *FakeQueue) Empty(key string) error
- func (f *FakeQueue) MultiConfirm(keys []string) []error
- func (f *FakeQueue) MultiPop(key string, n int) ([]string, [][]byte, error)
- func (f *FakeQueue) MultiPush(key string, datas [][]byte) error
- func (f *FakeQueue) Pop(key string) (string, []byte, error)
- func (f *FakeQueue) Push(key string, data []byte) error
- func (f *FakeQueue) Remove(key string) error
- func (f *FakeQueue) Stat(key string) (*Stat, error)
- type InflightMessage
- func (m *InflightMessage) Marshal() (data []byte, err error)
- func (m *InflightMessage) MarshalTo(data []byte) (int, error)
- func (*InflightMessage) ProtoMessage()
- func (m *InflightMessage) Reset()
- func (m *InflightMessage) Size() (n int)
- func (m *InflightMessage) String() string
- func (m *InflightMessage) Unmarshal(data []byte) error
- type MessageQueue
- type Stat
- type UnitedLineStore
- func (m *UnitedLineStore) Marshal() (data []byte, err error)
- func (m *UnitedLineStore) MarshalTo(data []byte) (int, error)
- func (*UnitedLineStore) ProtoMessage()
- func (m *UnitedLineStore) Reset()
- func (m *UnitedLineStore) Size() (n int)
- func (m *UnitedLineStore) String() string
- func (m *UnitedLineStore) Unmarshal(data []byte) error
- type UnitedQueue
- func (u *UnitedQueue) Close()
- func (u *UnitedQueue) Confirm(key string) error
- func (u *UnitedQueue) Create(key, arg string) error
- func (u *UnitedQueue) Empty(key string) error
- func (u *UnitedQueue) MultiConfirm(keys []string) []error
- func (u *UnitedQueue) MultiPop(key string, n int) ([]string, [][]byte, error)
- func (u *UnitedQueue) MultiPush(key string, datas [][]byte) error
- func (u *UnitedQueue) Pop(key string) (string, []byte, error)
- func (u *UnitedQueue) Push(key string, data []byte) error
- func (u *UnitedQueue) Remove(key string) error
- func (u *UnitedQueue) Stat(key string) (*Stat, error)
- type UnitedQueueStore
- func (m *UnitedQueueStore) Marshal() (data []byte, err error)
- func (m *UnitedQueueStore) MarshalTo(data []byte) (int, error)
- func (*UnitedQueueStore) ProtoMessage()
- func (m *UnitedQueueStore) Reset()
- func (m *UnitedQueueStore) Size() (n int)
- func (m *UnitedQueueStore) String() string
- func (m *UnitedQueueStore) Unmarshal(data []byte) error
- type UnitedTopicStore
- func (m *UnitedTopicStore) Marshal() (data []byte, err error)
- func (m *UnitedTopicStore) MarshalTo(data []byte) (int, error)
- func (*UnitedTopicStore) ProtoMessage()
- func (m *UnitedTopicStore) Reset()
- func (m *UnitedTopicStore) Size() (n int)
- func (m *UnitedTopicStore) String() string
- func (m *UnitedTopicStore) Unmarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
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) MultiConfirm ¶
MultiConfirm implements MultiConfirm 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) 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) ToMcString ¶
ToMcString returns the memcached string of Stat
func (*Stat) ToRedisStrings ¶
ToRedisStrings returns the redis 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) 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) 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) 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
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) 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) 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