datum

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

Datum Core

This repository is experimental meaning that it's based on untested ideas or techniques and not yet established or finalized or involves a radically new and innovative style! This means that support is best effort (at best!) and we strongly encourage you to NOT use this in production - reach out to @matoszz with any questions

This repo will hold the core server / handler for Datum services - for complete detailed references please check out the go-template used to generate this repository; it can be found here

Development

Datum's core server operates with the following utilities:

  1. ent - insane entity mapping tool, definitely not an ORM but kind of an ORM
  2. atlas - Schema generation and migration
  3. gqlgen - Code generation from schema definitions
  4. openfga - Authorization
Dependencies

Setup Taskfile by following the instructions and using one of the various convenient package managers or installation scripts. You can then simply run task install to load the associated dependencies. Nearly everything in this repository assumes you already have a local golang environment setup so this is not included. Please see the associated documentation.

To include Taskfile's created in other directories / to call the respective tasks, you would add an includes per the Taskfile documentation and then reference it by name, e.g. task cli:createorg

Pre-requisites to a PR

This repository contains a number of code generating functions / utilities which take schema modifications and scaffold out resolvers, graphql API schemas, openAPI specifications, among other things. To ensure you've generated all the necessary dependencies run task pr; this will run the entirety of the commands required to safely generate a PR. If for some reason one of the commands fails / encounters an error, you will need to debug the individual steps. It should be decently easy to follow the Taskfile in the root of this repository.

Querying

The best method of forming / testing queries against the server is to run task rover which will launch an interactive query UI.

OpenFGA Playground

You can load up a local openFGA environment with the compose setup in this repository; task compose:fga - this will launch an interactive playground where you can model permissions model(s) or changes to the models

Migrations

task atlas or task atlas:create will generate the necessary migrations

Documentation

Overview

package main is the entry point

Directories

Path Synopsis
cmd
Package cmd is our cobra/viper cli implementation
Package cmd is our cobra/viper cli implementation
cli command
cli/cmd
Package datum is our cobra/viper cli implementation
Package datum is our cobra/viper cli implementation
internal
api
Package api is the graphapi package
Package api is the graphapi package
constants
Package constants contains constants used throughout the application
Package constants contains constants used throughout the application
echox
Package echox adds helper functions for the echo server
Package echox adds helper functions for the echo server
ent/generated
Package generated is the ent generated package
Package generated is the ent generated package
ent/mixin
Package mixin contains the mixin package
Package mixin contains the mixin package
ent/privacy/rule
Package rule contains policy rules
Package rule contains policy rules
ent/privacy/viewer
Package viewer contains role definitions for policies
Package viewer contains role definitions for policies
ent/schema
Package schema contains the ent schema
Package schema contains the ent schema
entclean command
nolint
nolint
entdb
Package entdb extends the ent db library
Package entdb extends the ent db library
entx
Package entx is a package of tools for interacting with ent
Package entx is a package of tools for interacting with ent

Jump to

Keyboard shortcuts

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