本文整理汇总了Golang中github.com/ryanjdew/go-marklogic-go/util.Execute函数的典型用法代码示例。如果您正苦于以下问题:Golang Execute函数的具体用法?Golang Execute怎么用?Golang Execute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Execute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: setQueryOptions
// SetQueryOptions shows all the installed REST extensions
func setQueryOptions(c *clients.Client, optionsName string, options handle.Handle, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "PUT", "/config/query/"+optionsName, options)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例2: StructuredSearch
// StructuredSearch searches with a structured query
func StructuredSearch(c *clients.Client, query handle.Handle, start int64, pageLength int64, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "POST", "/search?start="+strconv.FormatInt(start, 10)+"&pageLength="+strconv.FormatInt(pageLength, 10), query)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例3: resetProperties
// ResetProperties resets the REST API properties to their default
func resetProperties(c *clients.Client, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "DELETE", "/config/properties", nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例4: setPropertyValue
// SetPropertyValue sets a property of the REST API
func setPropertyValue(c *clients.Client, propertyName string, property handle.Handle, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "PUT", "/config/properties/"+propertyName, property)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例5: setNamespace
// SetNamespace shows the namespaces used in queries
func setNamespace(c *clients.Client, namespace handle.Handle, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "PUT", "/config/namespaces", namespace)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例6: getQueryOptions
// GetQueryOptions returns the named REST query options
func getQueryOptions(c *clients.Client, name string, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "GET", "/config/query/"+name, nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例7: initialize
// Initialize MarkLogic instance
func initialize(ac *clients.AdminClient, license handle.Handle, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(ac, "POST", "/init", license)
if err != nil {
return err
}
return util.Execute(ac, req, response)
}
示例8: Search
// Search with text value
func Search(c *clients.Client, text string, start int64, pageLength int64, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "GET", "/search?q="+text+"&start="+strconv.FormatInt(start, 10)+"&pageLength="+strconv.FormatInt(pageLength, 10), nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例9: GetDatabaseProperties
// GetDatabaseProperties sets the database properties
func GetDatabaseProperties(mc *clients.ManagementClient, databaseName string, propertiesHandle handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(mc, "GET", "/databases/"+databaseName+"/properties", nil)
if err != nil {
return err
}
return util.Execute(mc, req, propertiesHandle)
}
示例10: deleteExtensions
// DeleteExtensions shows all the installed REST extensions
func deleteExtensions(c *clients.Client, directory string) error {
req, err := util.BuildRequestFromHandle(c, "DELETE", "/ext"+directory, nil)
if err != nil {
return err
}
return util.Execute(c, req, nil)
}
示例11: deleteResource
// DeleteResource removes a REST service
func deleteResource(c *clients.Client, name string, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "DELETE", "/config/resources/"+name, nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例12: listResources
// ListResources shows all the installed REST service extensions
func listResources(c *clients.Client, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "GET", "/config/resources", nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例13: deleteAllQueryOptions
// DeleteAllQueryOptions removes all the installed REST query options
func deleteAllQueryOptions(c *clients.Client, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "DELETE", "/config/query", nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例14: listExtensions
// ListExtensions shows all the installed REST extensions
func listExtensions(c *clients.Client, directory string, response handle.ResponseHandle) error {
req, err := util.BuildRequestFromHandle(c, "GET", "/ext"+directory, nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}
示例15: indexesReport
// IndexesReport shows the status of indexes in query options
func indexesReport(c *clients.Client, response handle.ResponseHandle) error {
req, err := http.NewRequest("GET", c.Base()+"/config/indexes", nil)
if err != nil {
return err
}
return util.Execute(c, req, response)
}