Documentation ¶
Index ¶
- func RegisterQueueServer(s *grpc.Server, srv QueueServer)
- type GRPCHandler
- type Header
- func (*Header) Descriptor() ([]byte, []int)
- func (m *Header) GetName() string
- func (m *Header) GetValue() []string
- func (*Header) ProtoMessage()
- func (m *Header) Reset()
- func (m *Header) String() string
- func (m *Header) XXX_DiscardUnknown()
- func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Header) XXX_Merge(src proto.Message)
- func (m *Header) XXX_Size() int
- func (m *Header) XXX_Unmarshal(b []byte) error
- type PeekRequest
- func (*PeekRequest) Descriptor() ([]byte, []int)
- func (m *PeekRequest) GetCount() int64
- func (m *PeekRequest) GetQueueName() string
- func (*PeekRequest) ProtoMessage()
- func (m *PeekRequest) Reset()
- func (m *PeekRequest) String() string
- func (m *PeekRequest) XXX_DiscardUnknown()
- func (m *PeekRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PeekRequest) XXX_Merge(src proto.Message)
- func (m *PeekRequest) XXX_Size() int
- func (m *PeekRequest) XXX_Unmarshal(b []byte) error
- type PeekResponse
- func (*PeekResponse) Descriptor() ([]byte, []int)
- func (m *PeekResponse) GetWebRequest() []*WebRequest
- func (*PeekResponse) ProtoMessage()
- func (m *PeekResponse) Reset()
- func (m *PeekResponse) String() string
- func (m *PeekResponse) XXX_DiscardUnknown()
- func (m *PeekResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PeekResponse) XXX_Merge(src proto.Message)
- func (m *PeekResponse) XXX_Size() int
- func (m *PeekResponse) XXX_Unmarshal(b []byte) error
- type PopRequest
- func (*PopRequest) Descriptor() ([]byte, []int)
- func (m *PopRequest) GetQueueName() string
- func (m *PopRequest) GetTimeout() *duration.Duration
- func (*PopRequest) ProtoMessage()
- func (m *PopRequest) Reset()
- func (m *PopRequest) String() string
- func (m *PopRequest) XXX_DiscardUnknown()
- func (m *PopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PopRequest) XXX_Merge(src proto.Message)
- func (m *PopRequest) XXX_Size() int
- func (m *PopRequest) XXX_Unmarshal(b []byte) error
- type PopResponse
- func (*PopResponse) Descriptor() ([]byte, []int)
- func (m *PopResponse) GetWebRequest() *WebRequest
- func (*PopResponse) ProtoMessage()
- func (m *PopResponse) Reset()
- func (m *PopResponse) String() string
- func (m *PopResponse) XXX_DiscardUnknown()
- func (m *PopResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PopResponse) XXX_Merge(src proto.Message)
- func (m *PopResponse) XXX_Size() int
- func (m *PopResponse) XXX_Unmarshal(b []byte) error
- type Queue
- type QueueClient
- type QueueServer
- type WebRequest
- func (*WebRequest) Descriptor() ([]byte, []int)
- func (m *WebRequest) GetBody() string
- func (m *WebRequest) GetHeader() []*Header
- func (m *WebRequest) GetHost() string
- func (m *WebRequest) GetReceivedAt() *timestamp.Timestamp
- func (w *WebRequest) MarshalJSON() ([]byte, error)
- func (*WebRequest) ProtoMessage()
- func (m *WebRequest) Reset()
- func (m *WebRequest) String() string
- func (w *WebRequest) UnmarshalJSON(src []byte) error
- func (m *WebRequest) XXX_DiscardUnknown()
- func (m *WebRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *WebRequest) XXX_Merge(src proto.Message)
- func (m *WebRequest) XXX_Size() int
- func (m *WebRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterQueueServer ¶
func RegisterQueueServer(s *grpc.Server, srv QueueServer)
Types ¶
type GRPCHandler ¶
type GRPCHandler struct {
// contains filtered or unexported fields
}
GRPCHandler handle grpc requests
func NewGRPCHandler ¶
func NewGRPCHandler(q Queue) *GRPCHandler
NewGRPCHandler returns a new GRPCHandler
func (*GRPCHandler) Peek ¶
func (g *GRPCHandler) Peek(ctx context.Context, request *PeekRequest) (*PeekResponse, error)
Peek shows the next few items in the queue
func (*GRPCHandler) Pop ¶
func (g *GRPCHandler) Pop(ctx context.Context, request *PopRequest) (*PopResponse, error)
Pop pops an item off the queue
type Header ¶
type Header struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Header) Descriptor ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶
func (*Header) XXX_Unmarshal ¶
type PeekRequest ¶
type PeekRequest struct { QueueName string `protobuf:"bytes,1,opt,name=QueueName,proto3" json:"QueueName,omitempty"` Count int64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeekRequest) Descriptor ¶
func (*PeekRequest) Descriptor() ([]byte, []int)
func (*PeekRequest) GetCount ¶
func (m *PeekRequest) GetCount() int64
func (*PeekRequest) GetQueueName ¶
func (m *PeekRequest) GetQueueName() string
func (*PeekRequest) ProtoMessage ¶
func (*PeekRequest) ProtoMessage()
func (*PeekRequest) Reset ¶
func (m *PeekRequest) Reset()
func (*PeekRequest) String ¶
func (m *PeekRequest) String() string
func (*PeekRequest) XXX_DiscardUnknown ¶
func (m *PeekRequest) XXX_DiscardUnknown()
func (*PeekRequest) XXX_Marshal ¶
func (m *PeekRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PeekRequest) XXX_Merge ¶
func (dst *PeekRequest) XXX_Merge(src proto.Message)
func (*PeekRequest) XXX_Size ¶
func (m *PeekRequest) XXX_Size() int
func (*PeekRequest) XXX_Unmarshal ¶
func (m *PeekRequest) XXX_Unmarshal(b []byte) error
type PeekResponse ¶
type PeekResponse struct { WebRequest []*WebRequest `protobuf:"bytes,1,rep,name=WebRequest,proto3" json:"WebRequest,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeekResponse) Descriptor ¶
func (*PeekResponse) Descriptor() ([]byte, []int)
func (*PeekResponse) GetWebRequest ¶
func (m *PeekResponse) GetWebRequest() []*WebRequest
func (*PeekResponse) ProtoMessage ¶
func (*PeekResponse) ProtoMessage()
func (*PeekResponse) Reset ¶
func (m *PeekResponse) Reset()
func (*PeekResponse) String ¶
func (m *PeekResponse) String() string
func (*PeekResponse) XXX_DiscardUnknown ¶
func (m *PeekResponse) XXX_DiscardUnknown()
func (*PeekResponse) XXX_Marshal ¶
func (m *PeekResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PeekResponse) XXX_Merge ¶
func (dst *PeekResponse) XXX_Merge(src proto.Message)
func (*PeekResponse) XXX_Size ¶
func (m *PeekResponse) XXX_Size() int
func (*PeekResponse) XXX_Unmarshal ¶
func (m *PeekResponse) XXX_Unmarshal(b []byte) error
type PopRequest ¶
type PopRequest struct { QueueName string `protobuf:"bytes,1,opt,name=QueueName,proto3" json:"QueueName,omitempty"` Timeout *duration.Duration `protobuf:"bytes,2,opt,name=Timeout,proto3" json:"Timeout,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PopRequest) Descriptor ¶
func (*PopRequest) Descriptor() ([]byte, []int)
func (*PopRequest) GetQueueName ¶
func (m *PopRequest) GetQueueName() string
func (*PopRequest) GetTimeout ¶
func (m *PopRequest) GetTimeout() *duration.Duration
func (*PopRequest) ProtoMessage ¶
func (*PopRequest) ProtoMessage()
func (*PopRequest) Reset ¶
func (m *PopRequest) Reset()
func (*PopRequest) String ¶
func (m *PopRequest) String() string
func (*PopRequest) XXX_DiscardUnknown ¶
func (m *PopRequest) XXX_DiscardUnknown()
func (*PopRequest) XXX_Marshal ¶
func (m *PopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PopRequest) XXX_Merge ¶
func (dst *PopRequest) XXX_Merge(src proto.Message)
func (*PopRequest) XXX_Size ¶
func (m *PopRequest) XXX_Size() int
func (*PopRequest) XXX_Unmarshal ¶
func (m *PopRequest) XXX_Unmarshal(b []byte) error
type PopResponse ¶
type PopResponse struct { WebRequest *WebRequest `protobuf:"bytes,1,opt,name=WebRequest,proto3" json:"WebRequest,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PopResponse) Descriptor ¶
func (*PopResponse) Descriptor() ([]byte, []int)
func (*PopResponse) GetWebRequest ¶
func (m *PopResponse) GetWebRequest() *WebRequest
func (*PopResponse) ProtoMessage ¶
func (*PopResponse) ProtoMessage()
func (*PopResponse) Reset ¶
func (m *PopResponse) Reset()
func (*PopResponse) String ¶
func (m *PopResponse) String() string
func (*PopResponse) XXX_DiscardUnknown ¶
func (m *PopResponse) XXX_DiscardUnknown()
func (*PopResponse) XXX_Marshal ¶
func (m *PopResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PopResponse) XXX_Merge ¶
func (dst *PopResponse) XXX_Merge(src proto.Message)
func (*PopResponse) XXX_Size ¶
func (m *PopResponse) XXX_Size() int
func (*PopResponse) XXX_Unmarshal ¶
func (m *PopResponse) XXX_Unmarshal(b []byte) error
type Queue ¶
type Queue interface { Peek(context.Context, string, int64) ([]*WebRequest, error) Pop(context.Context, string, time.Duration) (*WebRequest, error) Push(context.Context, string, []*WebRequest) error }
Queue is a queue
type QueueClient ¶
type QueueClient interface { Pop(ctx context.Context, in *PopRequest, opts ...grpc.CallOption) (*PopResponse, error) Peek(ctx context.Context, in *PeekRequest, opts ...grpc.CallOption) (*PeekResponse, error) }
QueueClient is the client API for Queue service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueueClient ¶
func NewQueueClient(cc *grpc.ClientConn) QueueClient
type QueueServer ¶
type QueueServer interface { Pop(context.Context, *PopRequest) (*PopResponse, error) Peek(context.Context, *PeekRequest) (*PeekResponse, error) }
QueueServer is the server API for Queue service.
type WebRequest ¶
type WebRequest struct { ReceivedAt *timestamp.Timestamp `protobuf:"bytes,1,opt,name=ReceivedAt,proto3" json:"ReceivedAt,omitempty"` Header []*Header `protobuf:"bytes,2,rep,name=Header,proto3" json:"Header,omitempty"` Host string `protobuf:"bytes,3,opt,name=Host,proto3" json:"Host,omitempty"` Body string `protobuf:"bytes,4,opt,name=Body,proto3" json:"Body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewWebRequestFromHTTPRequest ¶
NewWebRequestFromHTTPRequest is a helper to build a WebRequest from an HTTP request
func (*WebRequest) Descriptor ¶
func (*WebRequest) Descriptor() ([]byte, []int)
func (*WebRequest) GetBody ¶
func (m *WebRequest) GetBody() string
func (*WebRequest) GetHeader ¶
func (m *WebRequest) GetHeader() []*Header
func (*WebRequest) GetHost ¶
func (m *WebRequest) GetHost() string
func (*WebRequest) GetReceivedAt ¶
func (m *WebRequest) GetReceivedAt() *timestamp.Timestamp
func (*WebRequest) MarshalJSON ¶
func (w *WebRequest) MarshalJSON() ([]byte, error)
MarshalJSON creates a json representation of q WebRequest
func (*WebRequest) ProtoMessage ¶
func (*WebRequest) ProtoMessage()
func (*WebRequest) Reset ¶
func (m *WebRequest) Reset()
func (*WebRequest) String ¶
func (m *WebRequest) String() string
func (*WebRequest) UnmarshalJSON ¶
func (w *WebRequest) UnmarshalJSON(src []byte) error
UnmarshalJSON builds a WebRequest from JSON
func (*WebRequest) XXX_DiscardUnknown ¶
func (m *WebRequest) XXX_DiscardUnknown()
func (*WebRequest) XXX_Marshal ¶
func (m *WebRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WebRequest) XXX_Merge ¶
func (dst *WebRequest) XXX_Merge(src proto.Message)
func (*WebRequest) XXX_Size ¶
func (m *WebRequest) XXX_Size() int
func (*WebRequest) XXX_Unmarshal ¶
func (m *WebRequest) XXX_Unmarshal(b []byte) error
Directories ¶
Path | Synopsis |
---|---|
Package mockqueue is a generated GoMock package.
|
Package mockqueue is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.