Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hcl-tech-software/domino-rest-sdk-go
GO SDK to access the HCL Domino REST API
https://github.com/hcl-tech-software/domino-rest-sdk-go
domino go golang rest rest-api
Last synced: 8 days ago
JSON representation
GO SDK to access the HCL Domino REST API
- Host: GitHub
- URL: https://github.com/hcl-tech-software/domino-rest-sdk-go
- Owner: HCL-TECH-SOFTWARE
- Created: 2023-11-29T15:19:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-16T13:59:11.000Z (6 months ago)
- Last Synced: 2024-12-20T12:15:40.079Z (15 days ago)
- Topics: domino, go, golang, rest, rest-api
- Language: Go
- Homepage: https://opensource.hcltechsw.com/Domino-rest-api/index.html
- Size: 1010 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Domino REST API Golang SDK
Domino REST Go SDK is a package build designed to assist developers in integrating Domino with their applications.
Š 2023 HCL America Inc. Apache-2.0 license [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
## đ Documentation
- [Domino REST API documentation](https://opensource.hcltechsw.com/Domino-rest-api/index.html)
- [Using Domino REST API Go SDK examples](/examples/)## âŦī¸ Installation
First step is to install and configure Golang. Below is the link to follow the installation and configuration process.
```
https://go.dev/doc/install
```## â Highlights
- Supports both JavaScript and TypeScript.
- Has built-in methods for the following Domino REST API calls:
- **Basis**:
- `/document`
- `/document/{unid}`
- `/bulk/create`
- `/bulk/{unid}`
- `/bulk/update`
- `/bulk/delete`
- `/query`
- `/lists`
- `/lists/{name}`
- `/listspivot/{name}`
- **Setup**:
- `/design/{designType}/{designName}`
- `/admin/scope`
- `/admin/scopes`## đĻ Importing
You can import the whole SDK by:
```
// Using golang get command
go get github.com/HCL-TECH-SOFTWARE/domino-rest-sdk-go
```You can also import within your Golang file:
```
import "github.com/HCL-TECH-SOFTWARE/domino-rest-sdk-go"
```## đŦ Overview
![Domino REST API Go SDK Model](/docs/sdk-model.png)
Domino REST API Go SDK has four moving parts:
- `DominoAccess`
- `DominoServer`
- `DominoConnector`
- `DominoSession`### âšī¸ DominoAccess
`DominoAccess` is a function that facilitates your access to the Domino REST API server. It takes in a `baseUrl`, which is your Idp provider, as well as your credentials, such as your `username`, `password`, `scope` and `type` (the authentication type: `basic` or `oauth`).
### âšī¸ DominoServer
`DominoServer` is a function that gets information on what APIs are available on your current server. It takes in a url to your Domino REST API server as a parameter. This class produces a `ConnectorMethods` interface base on your chosen API.
### âšī¸ DominoConnector
`DominoConnector` is the function that does the actual communication between the Domino REST API Go SDK and your Domino REST API server.
### âšī¸ Session
`DominoUserSession` is a class that contains all the operation you can perform on your Domino REST API server. It includes built-in methods, and a generic request method if you want to execute an operation on your own.
### đŽ Running a Domino REST API operation using the SDK
Here is an example of how to use the four moving parts mentioned above in order to execute one Domino REST API Go SDK.
```Go
import (
"fmt"
gosdk "https://github.com/HCL-TECH-SOFTWARE/domino-rest-sdk-go"
)config := new(gosdk.Config)
config.BaseUrl = "http://localhost:8880"
config.Credentials.Scope = "$DATA"
config.Credentials.Type = "BASIC"
config.Credentials.UserName = "username"
config.Credentials.Password = "password"access, err := config.DominoAccess()
if err != nil {
fmt.Println(err.Error())
}server, err := gosdk.DominoServer(access.GetBaseUrl())
if err != nil {
fmt.Println(err.Error())
}connector, err := server.GetConnector("basis")
if err != nil {
fmt.Println(err.Error())
}session := new(gosdk.SessionConfig)
session.AccessMethods = access
session.ConnectorMethods = connectorsession := session.UserSession()
// Get a domino document example
result, err := session.GetDocument("parameter1", "parameter2", ...)
if err != nil {
fmt.Println(err)
}
fmt.Println(result)
```For other examples, please go to our [examples](/examples/operations/).