datum-cloud

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

Go Report Card Build status Go Reference

Datum Cloud

Building a SaaS offering on top of Datum

Datum Cloud Server

The Datum Cloud server is used to consume the Datum Server and apply an opinionated implementation on top of the the generics provided. Many, if not all, of the endpoints provided by the server use the Datum Client to make requests to the Datum Server.

As an example, the v1/workspaces endpoint uses the Datum client to create an organizational hierarchy, called a Workspace:

│   └── rootorg <--- top level organization
│       ├── production <-- top level environment per customer organization
│       │   ├── assets <-- buckets
│       │   ├── customers
│       │   ├── orders
│       │   ├── relationships
│       │   │   ├── internal_users  <-- relationships
│       │   │   ├── marketing_subscribers
│       │   │   ├── marketplaces
│       │   │   ├── partners
│       │   │   └── vendors
│       │   └── sales
│       └── test <-- organization identical to production just named

Datum Cloud CLI

The Datum Cloud cli is used to interact with the Datum Cloud Server as well as some requests directly to the Datum Server using the Datum Client. In order to use the cli, you must have a registered user with the Datum Server.

Installation
brew install datumforge/tap/datum-cloud
Upgrade
brew upgrade datumforge/tap/datum-cloud
Usage
datum-cloud
the datum-cloud cli

Usage:
  datum-cloud [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  seed        the subcommands for creating demo data in datum
  workspace   the subcommands for working with the datum workspace

Seeding Data

The datum-cloud cli has functionality to generate and load test data into datum using the seed command.

Usage:
  datum-cloud seed [command]

Available Commands:
  generate    generate random data for seeded environment
  init        init a new datum seeded environment
Using the Taskfile

On a brand new database, you should run:

  1. Create a new user to authenticate with the Datum API, this command will fail on subsequent tries because the user will already exist.
    task register
    
  2. Login as the user, create a new Personal Access Token that will be used to seed the data, generate a new data set, bulk load objects into the Datum API:
    task cli:seed:all
    

If instead, you prefer to use the CLI commands directly, keep reading.

Generate Data

Using the generate subcommand, new random data will be stored in csv files:

datum-cloud seed generate
Generated Data
tree demodata
demodata
├── groups.csv
├── invites.csv
├── orgs.csv
└── users.csv
Init Environment

Using the init subcommand, the data in the specified directory (defaults to demodata in the current directory), the csv files will be used to generate the data.

datum-cloud seed init

The newly created objects will be displayed when complete:

Results
> seeded environment created 100% [===============]  [3s]
Seeded Environment Created:
+--------------------------------------------------------------------------------------+
| Organization                                                                         |
+----------------------------+--------+-------------+-------------+----------+---------+
| ID                         | NAME   | DESCRIPTION | PERSONALORG | CHILDREN | MEMBERS |
+----------------------------+--------+-------------+-------------+----------+---------+
| 01J06RPZ8HQRWW4AZERHKWT2YH | Plus-U |             | false       |        0 |       1 |
+----------------------------+--------+-------------+-------------+----------+---------+
...

Contributing

Please read the contributing guide as well as the Developer Certificate of Origin. You will be required to sign all commits to the Datum project, so if you're unfamiliar with how to set that up, see github's documentation.

Licensing

This repository contains datum-cloud which is open source software under Apache 2.0. Datum-Cloud is a product produced from this open source software exclusively by Datum Technology, Inc. This product is produced under our published commercial terms (which are subject to change), and any logos or trademarks in this repository or the broader datumforge organization are not covered under the Apache License.

Others are allowed to make their own distribution of this software or include this software in other commercial offerings, but cannot use any of the Datum logos, trademarks, cloud services, etc.

Security

We take the security of our software products and services seriously, including all of the open source code repositories managed through our Github Organizations, such as datumforge. If you believe you have found a security vulnerability in any of our repositories, please report it to us through coordinated disclosure.

Please do NOT report security vulnerabilities through public github issues, discussions, or pull requests!

Instead, please send an email to security@datum.net with as much information as possible to best help us understand and resolve the issues. See the security policy attached to this repository for more details.

Questions?

You can email us at info@datum.net, open a github issue in this repository, or reach out to matoszz directly.

Documentation

Overview

package main is the entry point

Directories

Path Synopsis
cmd
Package cmd is our cobra cli implementation
Package cmd is our cobra cli implementation
cli
cli/cmd
Package datumcloud is our cobra cli implementation
Package datumcloud is our cobra cli implementation
Package config holds configuration stuff to configure the things
Package config holds configuration stuff to configure the things
internal
client
Package client provides a client for the API.
Package client provides a client for the API.
constants
Package constants contains constants used throughout the application
Package constants contains constants used throughout the application
datum
Package datum is a wrapper used to interact with the datum API
Package datum is a wrapper used to interact with the datum API
httpserve/config
Package config holds the echo server configuration utilities
Package config holds the echo server configuration utilities
httpserve/handlers
Package handlers contains custom handler functions
Package handlers contains custom handler functions
httpserve/route
Package route will hold the routes and route groups
Package route will hold the routes and route groups
httpserve/server
Package server contains the server functions
Package server contains the server functions
httpserve/serveropts
Package serveropts contains an echo server options wrapper
Package serveropts contains an echo server options wrapper
seed
Package seed is used to generate test data for a demo or seeded environment.
Package seed is used to generate test data for a demo or seeded environment.
v1/models
Package models provides http request and response structs
Package models provides http request and response structs
envparse
Package envparse provides a way to parse environment variables from a struct
Package envparse provides a way to parse environment variables from a struct

Jump to

Keyboard shortcuts

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