keystone

command module
v0.0.0-...-f907250 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

Keystone, the go version

Development environment

.env file
KSAUTH_URL= # url to the auth cloud function
KSAPI_URL=  # url to the api cloud function
DATABASE_URL= # postgres url for migrations
Development dependencies
  1. Google CLoud CLI: Recommended Install
  2. Cloud SQL Proxy: Intall it from here
  3. Golang Migrate: brew install golang-migrate
Development Runtime
Development database access
cloud_sql_proxy \
    -dir /tmp/cloudsql \
    -instances=wearedevx:europe-west6:devx=tcp:5432 \
    -credential_file=functions/ksapi/wearedevx-aa84b56c44de.json

Note : You need a valid gcloud credentials file

Local functions

For the api function

cd functions/ksapi/cmd
go run main.go

For the auth function

cd fucntions/ksapi/cmd
go run main.go
Running the development version
./run.sh [options] [command]
Building the release version
./build.sh

The release binary is ks

Database migration

Generate migrations
./gen.migration.sh create_an_example_table

Creates:

  • db/migrations/xxxxxx_create_an_example_table.down.sh
  • db/migrations/xxxxxx_create_an_example_table.up.sh
Run migrations

Upward:

./migrate.sh up

Backward:

./migrate.sh down

Specific version:

./migrate.sh force $VERSION

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
api module
cli module
internal
jwt
repo
Package repo provides ...
Package repo provides ...
utils
From https://samrapdev.com/capturing-sensitive-input-with-editor-in-golang-from-the-cli/
From https://samrapdev.com/capturing-sensitive-input-with-editor-in-golang-from-the-cli/
pkg

Jump to

Keyboard shortcuts

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