本文整理匯總了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)
}