github.com/ravendb/ravendb-go-client@v0.0.0-20240229102137-4474ee7aa0fa/delete_subscription_command.go (about) 1 package ravendb 2 3 import ( 4 "net/http" 5 ) 6 7 var ( 8 _ RavenCommand = &DeleteSubscriptionCommand{} 9 ) 10 11 // DeleteSubscriptionCommand describes "delete subscription" command 12 type DeleteSubscriptionCommand struct { 13 RavenCommandBase 14 15 name string 16 } 17 18 func newDeleteSubscriptionCommand(name string) *DeleteSubscriptionCommand { 19 cmd := &DeleteSubscriptionCommand{ 20 RavenCommandBase: NewRavenCommandBase(), 21 22 name: name, 23 } 24 cmd.ResponseType = RavenCommandResponseTypeEmpty 25 return cmd 26 } 27 28 func (c *DeleteSubscriptionCommand) CreateRequest(node *ServerNode) (*http.Request, error) { 29 url := node.URL + "/databases/" + node.Database + "/subscriptions?taskName=" + urlUtilsEscapeDataString(c.name) 30 31 return newHttpDelete(url, nil) 32 }