gomarklogicgo

package module
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

Go, MarkLogic. Go!

This a Go library for interacting with MarkLogic's REST APIs.

Go, MarkLogic. Go!
Look at those MarkLogicians go!
Where is MarkLogic going with those programming stars?
What are they going to do?
Where are those MarkLogicians going?
Look where they are going.
They are all going to that big data out there.
It's a data party. A BIG data party!
XML data. JSON data. Semantic data.

Status

GoDoc Build Status

Sample Code

import (
	"fmt"
	marklogic "github.com/ryanjdew/go-marklogic-go"
	handle "github.com/ryanjdew/go-marklogic-go/handle"
	search "github.com/ryanjdew/go-marklogic-go/search"
)
func main() {
  db, _ := marklogic.NewClient("localhost", 8050, "admin", "admin", marklogic.DigestAuth)
  query := search.Query{}
  query.Queries = []interface{}{
    search.TermQuery{
      Terms: []string{queryStr},
    },
  }
  qh := search.QueryHandle{Format: handle.XML}
  qh.Serialize(query)
  respHandle := search.ResponseHandle{}
  err = db.Search().StructuredSearch(&qh, 1, 10, nil, &respHandle)
  resp := respHandle.Get()
  fmt.Print(respHandle.Serialized())
}

Documentation

Overview

Package gomarklogicgo provides a way to interact with MarkLogic's REST API.

Index

Constants

View Source
const (
	BasicAuth  = clients.BasicAuth
	DigestAuth = clients.DigestAuth
	None       = clients.None
)

Authentication options

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client clients.Client

Client is used for connecting to the MarkLogic REST API.

func New

func New(config *Connection) (*Client, error)

New creates the Client struct used for searching, etc.

func NewClient

func NewClient(host string, port int64, username string, password string, authType int) (*Client, error)

NewClient creates the Client struct used for searching, etc.

func (*Client) Alerting

func (c *Client) Alerting() *alert.Service

Alerting service

func (*Client) Config

func (c *Client) Config() *config.Service

Config service

func (*Client) DataMovement

func (c *Client) DataMovement() *datamovement.Service

DataMovement service

func (*Client) DataServices

func (c *Client) DataServices() *dataservices.Service

DataServices service

func (*Client) Documents

func (c *Client) Documents() *documents.Service

Documents service

func (*Client) NewTransaction

func (c *Client) NewTransaction() *util.Transaction

NewTransaction returns a new transaction struct

func (*Client) RowsManagement

func (c *Client) RowsManagement() *rowsManagement.Service

RowsManagement service

func (*Client) Search

func (c *Client) Search() *search.Service

Search service

func (*Client) Semantics

func (c *Client) Semantics() *semantics.Service

Semantics service

type Connection

type Connection clients.Connection

Connection is used for defining the connection to the MarkLogic REST API.

type ManagementClient

type ManagementClient clients.ManagementClient

ManagementClient is used for connecting to the MarkLogic Management API.

func NewManagementClient

func NewManagementClient(host string, username string, password string, authType int) (*ManagementClient, error)

NewManagementClient creates the Client struct used for managing databases, etc.

func (*ManagementClient) GetDatabaseProperties

func (mc *ManagementClient) GetDatabaseProperties(databaseName string, propertiesHandle handle.ResponseHandle) error

GetDatabaseProperties sets the database properties

func (*ManagementClient) SetDatabaseProperties

func (mc *ManagementClient) SetDatabaseProperties(databaseName string, propertiesHandle handle.ResponseHandle) error

SetDatabaseProperties sets the database properties

Directories

Path Synopsis
Package admin can initialize MarkLogic instances
Package admin can initialize MarkLogic instances
Package alert works with the MarkLogic Alerting API
Package alert works with the MarkLogic Alerting API
Package clients provides clients for working with MarkLogic.
Package clients provides clients for working with MarkLogic.
Package config can configure the MarkLogic REST server
Package config can configure the MarkLogic REST server
Package datamovement provides way to read and write in bulk
Package datamovement provides way to read and write in bulk
Package dataservices provides a way to call Data Services
Package dataservices provides a way to call Data Services
Package documents provides a way to read and write documents
Package documents provides a way to read and write documents
Package resources allows for interacting with custom REST extensions
Package resources allows for interacting with custom REST extensions
Package rowsManagement executes an Optic API plan
Package rowsManagement executes an Optic API plan
Package search interacts with the MarkLogic search API
Package search interacts with the MarkLogic search API
Package semantics interacts with MarkLogic's semantic APIs
Package semantics interacts with MarkLogic's semantic APIs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL