Skip to content

ijustfool/docker-secrets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-secrets

GoDoc Go Report

Requirements

Go 1.2 or above.

Installation

Run the following command to install the package:

go get github.com/ijustfool/docker-secrets

Usage

package main

import (
    "fmt"
    "github.com/ijustfool/docker-secrets"
)

func main() {
    dockerSecrets, _ := secrets.NewDockerSecrets("")

    // Get all secrets
    fmt.Println(dockerSecrets.GetAll())
    // print: map[secret_1:val_1 secret_2:val_2]

    // Get a single secret
    secret, _ := dockerSecrets.Get("secret_1")
    fmt.Println(secret)
    // print: val_1

    // Custom location
    dsCustomLoc, _ := secrets.NewDockerSecrets("/run/myCustomLocation")
}