当前位置: 首页>>代码示例>>Golang>>正文


Golang util.BuildRequestFromHandle函数代码示例

本文整理汇总了Golang中github.com/ryanjdew/go-marklogic-go/util.BuildRequestFromHandle函数的典型用法代码示例。如果您正苦于以下问题:Golang BuildRequestFromHandle函数的具体用法?Golang BuildRequestFromHandle怎么用?Golang BuildRequestFromHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BuildRequestFromHandle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:properties.go

示例2: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:properties.go

示例3: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:namespaces.go

示例4: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:query.go

示例5: 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)
}
开发者ID:ryanjdew,项目名称:go-marklogic-go,代码行数:8,代码来源:search.go

示例6: 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)
}
开发者ID:ryanjdew,项目名称:go-marklogic-go,代码行数:8,代码来源:search.go

示例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)
}
开发者ID:ryanjdew,项目名称:go-marklogic-go,代码行数:8,代码来源:init.go

示例8: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:databaseProperties.go

示例9: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:extensions.go

示例10: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:extensions.go

示例11: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:extensions.go

示例12: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:extensions.go

示例13: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:query.go

示例14: 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)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:8,代码来源:query.go

示例15: timestamp

// Verify that MarkLogic Server is up and accepting requests.
// https://docs.marklogic.com/REST/GET/admin/v1/timestamp
func timestamp(ac *clients.AdminClient, response handle.ResponseHandle) error {
	req, err := util.BuildRequestFromHandle(ac, "GET", "/timestamp", nil)
	if err != nil {
		return err
	}
	return util.Execute(ac, req, response)
}
开发者ID:ryanjdew,项目名称:go-marklogic-go,代码行数:9,代码来源:timestamp.go


注:本文中的github.com/ryanjdew/go-marklogic-go/util.BuildRequestFromHandle函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。