當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ServiceClient.Delete方法代碼示例

本文整理匯總了Golang中github.com/jrperritt/rack/internal/github.com/rackspace/gophercloud.ServiceClient.Delete方法的典型用法代碼示例。如果您正苦於以下問題:Golang ServiceClient.Delete方法的具體用法?Golang ServiceClient.Delete怎麽用?Golang ServiceClient.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/jrperritt/rack/internal/github.com/rackspace/gophercloud.ServiceClient的用法示例。


在下文中一共展示了ServiceClient.Delete方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: DeleteMetadatum

// DeleteMetadatum will delete the key-value pair with the given key for the given server ID.
func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) DeleteMetadatumResult {
	var res DeleteMetadatumResult
	_, res.Err = client.Delete(metadatumURL(client, id, key), &gophercloud.RequestOpts{
		JSONResponse: &res.Body,
	})
	return res
}
開發者ID:stephamon,項目名稱:rack,代碼行數:8,代碼來源:requests.go

示例2: Revoke

// Revoke immediately makes specified token invalid.
func Revoke(c *gophercloud.ServiceClient, token string) RevokeResult {
	var res RevokeResult
	_, res.Err = c.Delete(tokenURL(c), &gophercloud.RequestOpts{
		MoreHeaders: subjectTokenHeaders(c, token),
	})
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:8,代碼來源:requests.go

示例3: Delete

// Delete requests that a server previously provisioned be removed from your account.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
	var res DeleteResult
	_, res.Err = client.Delete(deleteURL(client, id), &gophercloud.RequestOpts{
		ErrorContext: &ServerError{id: id},
	})
	return res
}
開發者ID:harshalhshah,項目名稱:rack,代碼行數:8,代碼來源:requests.go

示例4: Delete

// Delete is a function that deletes a container.
func Delete(c *gophercloud.ServiceClient, containerName string) DeleteResult {
	var res DeleteResult
	_, res.Err = c.Delete(deleteURL(c, containerName), &gophercloud.RequestOpts{
		ErrorContext: &ContainerError{name: containerName},
	})
	return res
}
開發者ID:harshalhshah,項目名稱:rack,代碼行數:8,代碼來源:requests.go

示例5: Delete

// Delete is a function that deletes an object.
func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts DeleteOptsBuilder) DeleteResult {
	var res DeleteResult
	url := deleteURL(c, containerName, objectName)

	if opts != nil {
		query, err := opts.ToObjectDeleteQuery()
		if err != nil {
			res.Err = err
			return res
		}
		url += query
	}

	resp, err := c.Delete(url, nil)
	if resp != nil {
		res.Header = resp.Header
	}
	res.Err = err
	return res
}
開發者ID:stephamon,項目名稱:rack,代碼行數:21,代碼來源:requests.go

示例6: Delete

// Delete requests that a server previously provisioned be removed from your account.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
	var res DeleteResult
	_, res.Err = client.Delete(deleteURL(client, id), nil)
	return res
}
開發者ID:stephamon,項目名稱:rack,代碼行數:6,代碼來源:requests.go

示例7: Delete

// Delete is a function that deletes a container.
func Delete(c *gophercloud.ServiceClient, containerName string) DeleteResult {
	var res DeleteResult
	_, res.Err = c.Delete(deleteURL(c, containerName), nil)
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:6,代碼來源:requests.go

示例8: Delete

// Delete will permanently delete a particular security group based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
	var res DeleteResult
	_, res.Err = c.Delete(resourceURL(c, id), nil)
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:6,代碼來源:requests.go

示例9: Delete

// Delete accepts a unique ID and deletes the network associated with it.
func Delete(c *gophercloud.ServiceClient, networkID string) DeleteResult {
	var res DeleteResult
	_, res.Err = c.Delete(deleteURL(c, networkID), nil)
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:6,代碼來源:requests.go


注:本文中的github.com/jrperritt/rack/internal/github.com/rackspace/gophercloud.ServiceClient.Delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。