Coder Social home page Coder Social logo

ayatmaulana / doppler-go-runtime Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 19 KB

Using Doppler Secret Management direct in your golang runtime

License: GNU General Public License v3.0

Go 100.00%
doppler doppler-api doppler-cli golang secret-management vault vault-client doppler-golang

doppler-go-runtime's Introduction

Doppler Go Runtime

Doppler is a secret management that I use as an alternative to Hashicorp Vautl, because it is free and can be used for small and medium projects.

But for now there is no golang package to use Doppler directly in our Golang Application Runtime, for that this package was created.

๐Ÿฑย  Prerequesites

Here's what you have to prepare

๐Ÿš€ย  Installation

$ go get github.com/ayatmaulana/doppler-go-runtime

๐ŸŒดย  Usage

Before you use this package, make sure you have an doppler.yaml file in your root project folder with this content (ref: https://docs.doppler.com/docs/project-templates)

setup:
  project: your-project-name
  config: your-config-name

this package will auto discover your doppler.yaml file and use it to getting secret to Doppler Server

package main

import (
	"log"
	"os"

	"github.com/ayatmaulana/doppler-go-runtime"
)

func main(){
  doppler := dopplergoruntime.NewDopplerRuntime(dopplergoruntime.DopplerRuntimeConfig{
    Token: os.Getenv("DOPPLER_TOKEN"),
  })

  if err := doppler.Load(); err != nil {
    log.Println(err)
  }
}

if you want set the project and config programmatically you can also use the parameter

package main

import (
	"log"
	"os"

	"github.com/ayatmaulana/doppler-go-runtime"
)

func main(){
  doppler := dopplergoruntime.NewDopplerRuntime(dopplergoruntime.DopplerRuntimeConfig{
    Token: os.Getenv("DOPPLER_TOKEN"),
    Project: "your-project",
    Config: "your-config"
  })

  if err := doppler.Load(); err != nil {
    log.Println(err)
  }
}

and run with your Doppler Service Token like This

$ DOPPLER_TOKEN="dp.st.dev_xxxxxxxxxxxxxxxxx" go run main.go

๐Ÿ’ฝย  Options

  • Token - string
  • Project - string
  • Config - string
  • EnableDebug - boolean

๐Ÿคย  Found a bug? Missing a specific feature?

Feel free to file a new issue with a respective title and description. If you already found a solution to your problem, we would love to review your pull request!.

๐Ÿ“˜ย  License

This package is released under the under terms of the GNU GENERAL PUBLIC LICENSE .

doppler-go-runtime's People

Contributors

ayatmaulana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.