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.

31 lines
1.1 KiB

  1. package wdclient
  2. import (
  3. "context"
  4. "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
  5. )
  6. func (mc *MasterClient) CollectionDelete(ctx context.Context, collection string) error {
  7. return withMasterClient(ctx, mc.currentMaster, mc.grpcDialOption, func(ctx context.Context, client master_pb.SeaweedClient) error {
  8. _, err := client.CollectionDelete(ctx, &master_pb.CollectionDeleteRequest{
  9. Name: collection,
  10. })
  11. return err
  12. })
  13. }
  14. func (mc *MasterClient) CollectionList(ctx context.Context) (resp *master_pb.CollectionListResponse, err error) {
  15. err = withMasterClient(ctx, mc.currentMaster, mc.grpcDialOption, func(ctx context.Context, client master_pb.SeaweedClient) error {
  16. resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{})
  17. return err
  18. })
  19. return
  20. }
  21. func (mc *MasterClient) VolumeList(ctx context.Context) (resp *master_pb.VolumeListResponse, err error) {
  22. err = withMasterClient(ctx, mc.currentMaster, mc.grpcDialOption, func(ctx context.Context, client master_pb.SeaweedClient) error {
  23. resp, err = client.VolumeList(ctx, &master_pb.VolumeListRequest{})
  24. return err
  25. })
  26. return
  27. }