OSDU tutorials for various use cases in Go
Simple web application demonstrating how to use Authentication, Search and Delivery APIs
- Get client ID, client Secret, Authorization URL and API URL from your platform admin.
- Clone this repository.
- Go to 'quickstart' folder, rename default environment file to config-azure|aws|gcp.env and fill out the values:
# OAuth settings
OSDU_CLIENT_ID=<your-client-id>
OSDU_CLIENT_SECRET=<your-client-secret>
OSDU_AUTH_BASE_URL=<auth-server-url>
# API
OSDU_API_BASE_URL=<api-base-url>
- Download and install Go.
- Export environment variables:
For Azure
$ export $(grep -v '^#' config-azure.env | xargs -d '\n')
For AWS
$ export $(grep -v '^#' config-aws.env | xargs -d '\n')
- Build and run the server:
$ go run ./cmd/srv
- Go to http://localhost:8080
- Edit docker-compose.yml to include configuration to your environment:
version : '3'
services:
backend:
env_file:
- config-<your-env>.env
build: .
ports:
- "8080:8080"
command: /root/main
- Build the image and run the container:
$ docker-compose up --build
- Go to http://localhost:8080