• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang util.BuildRequestFromHandle函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetServerProperties

// GetServerProperties sets the database properties
func GetServerProperties(mc *clients.ManagementClient, serverName string, groupID string, properties handle.ResponseHandle) error {
	if groupID == "" {
		groupID = "Default"
	}
	req, err := util.BuildRequestFromHandle(mc, "GET", "/servers/"+serverName+"/propertie?group-id="+groupID, nil)
	if err != nil {
		return err
	}
	return util.Execute(mc, req, properties)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:11,代码来源:serverProperties.go


示例17: instanceAdmin

// Install the admin username and password, and initialize the security database and objects.
func instanceAdmin(ac *clients.AdminClient, username string, password string, realm string, response handle.ResponseHandle) error {
	params := "?"
	params = util.RepeatingParameters(params, "admin-username", []string{username})
	params = util.RepeatingParameters(params, "admin-password", []string{password})
	params = util.RepeatingParameters(params, "realm", []string{realm})
	req, err := util.BuildRequestFromHandle(ac, "POST", "/instance-admin"+params, nil)
	if err != nil {
		return err
	}
	return util.Execute(ac, req, response)
}
开发者ID:ryanjdew,项目名称:go-marklogic-go,代码行数:12,代码来源:instanceAdmin.go


示例18: StructuredSuggestions

// StructuredSuggestions suggests query text based off of a structured query
func StructuredSuggestions(c *clients.Client, query handle.Handle, partialQ string, limit int64, options string, response handle.ResponseHandle) error {
	uri := "/suggest?limit=" + strconv.FormatInt(limit, 10)
	if options != "" {
		uri = uri + "&options=" + options
	}
	req, err := util.BuildRequestFromHandle(c, "POST", uri, query)
	if err != nil {
		return err
	}
	return util.Execute(c, req, response)
}
开发者ID:rlouapre,项目名称:go-marklogic-go,代码行数:12,代码来源:suggest.go



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang util.Execute函数代码示例发布时间:2022-05-28
下一篇:
Golang fsm.Ruleset类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap