json

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsafePermission = errors.New("secrets.json file has unsafe permission")

Functions

func SanitizeName

func SanitizeName(name string) string

SanitizeName sanitizes the name so that it's safe to use as a filename.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(dir string) Provider

func (Provider) Get

func (p Provider) Get(service string, v interface{}) error

Get unmarshals the service from the JSON secret file. It errors out if the secret file does not exist.

func (Provider) Set

func (p Provider) Set(service string, v interface{}) error

Set writes the service's data into a JSON secret file.

Jump to

Keyboard shortcuts

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