github.com/altipla-consulting/ravendb-go-client@v0.1.3/drop_subscription_connection_command.go (about)

     1  package ravendb
     2  
     3  import (
     4  	"net/http"
     5  )
     6  
     7  var (
     8  	_ RavenCommand = &DropSubscriptionConnectionCommand{}
     9  )
    10  
    11  // DropSubscriptionConnectionCommand describes "drop subscription" command
    12  type DropSubscriptionConnectionCommand struct {
    13  	RavenCommandBase
    14  
    15  	name string
    16  }
    17  
    18  func newDropSubscriptionConnectionCommand(name string) *DropSubscriptionConnectionCommand {
    19  	cmd := &DropSubscriptionConnectionCommand{
    20  		RavenCommandBase: NewRavenCommandBase(),
    21  
    22  		name: name,
    23  	}
    24  	cmd.ResponseType = RavenCommandResponseTypeEmpty
    25  	return cmd
    26  }
    27  
    28  func (c *DropSubscriptionConnectionCommand) createRequest(node *ServerNode) (*http.Request, error) {
    29  	url := node.URL + "/databases/" + node.Database + "/subscriptions/drop?name=" + urlUtilsEscapeDataString(c.name)
    30  
    31  	return newHttpPost(url, nil)
    32  }