You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

  1. package weed_server
  2. import (
  3. "context"
  4. "google.golang.org/grpc"
  5. "github.com/chrislusf/seaweedfs/weed/pb/queue_pb"
  6. "github.com/chrislusf/seaweedfs/weed/security"
  7. "github.com/chrislusf/seaweedfs/weed/util"
  8. )
  9. type QueueServerOption struct {
  10. Filers []string
  11. DefaultReplication string
  12. MaxMB int
  13. Port int
  14. }
  15. type QueueServer struct {
  16. option *QueueServerOption
  17. grpcDialOption grpc.DialOption
  18. }
  19. func (q *QueueServer) ConfigureTopic(context.Context, *queue_pb.ConfigureTopicRequest) (*queue_pb.ConfigureTopicResponse, error) {
  20. panic("implement me")
  21. }
  22. func (q *QueueServer) DeleteTopic(context.Context, *queue_pb.DeleteTopicRequest) (*queue_pb.DeleteTopicResponse, error) {
  23. panic("implement me")
  24. }
  25. func (q *QueueServer) StreamWrite(queue_pb.SeaweedQueue_StreamWriteServer) error {
  26. panic("implement me")
  27. }
  28. func (q *QueueServer) StreamRead(*queue_pb.ReadMessageRequest, queue_pb.SeaweedQueue_StreamReadServer) error {
  29. panic("implement me")
  30. }
  31. func NewQueueServer(option *QueueServerOption) (qs *QueueServer, err error) {
  32. qs = &QueueServer{
  33. option: option,
  34. grpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.queue"),
  35. }
  36. return qs, nil
  37. }