murmur

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Murmur

Go library for simple access to a YAML formatted password file.

How to use it

$ cat ~/.murmur.yaml
fooapp: topsecret
barapp: hunter3

$ cat mtest.go
package main

import (
    "fmt"
    "github.com/mschilli/go-murmur"
)

func main() {
    m := murmur.NewMurmur()
    val, err := m.Lookup("barapp")

    if err != nil {
	panic(err)
    }

    fmt.Printf("val: %s\n", val)
}

$ ./mtest
val=hunter3

Author

Mike Schilli, m@perlmeister.com 2024

License

Released under the Apache 2.0

Documentation

Index

Constants

View Source
const StoreFileName = ".murmur"
View Source
const Version = "1.0.5"

Variables

This section is empty.

Functions

This section is empty.

Types

type Murmur

type Murmur struct {
	FilePath string

	Dict map[string]string
	// contains filtered or unexported fields
}

Read secrets from a .murmur YAML file

func NewMurmur

func NewMurmur() *Murmur

Create a new instance

func (*Murmur) Lookup

func (m *Murmur) Lookup(name string) (string, error)

Look up a .murmur key by name and return its value

func (*Murmur) Read added in v1.0.4

func (m *Murmur) Read() error

Read the .murmur file into the internal cache

func (*Murmur) WithFilePath

func (m *Murmur) WithFilePath(path string) *Murmur

Set the .murmur file path manually

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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