secrets

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItem

func GetItem(itemName string, opts ...Options) (*onepassword.Item, error)

GetItem gets a 1password item from the 1password connect api server. Options may be passed through the opts parameter.

func LoadItem

func LoadItem(itemName string, i interface{}, opts ...Options) error

LoadItem loads an item and unmarshalls it into `i`. This is equivalent to calling GetItem followed by an UnmarshallItem into `i`.

func UnmarshallItem

func UnmarshallItem(item *onepassword.Item, i interface{}) error

UnmarshallItem unmarshalls item into `i`. `i` must be a pointer to a struct. The struct should contain exported fields of type int or string that contain the tag "opfield" with the name of the field to be put in the field.

Types

type Options

type Options func(*optionsStruct)

Options to pass into GetItem and LoadItem.

func WithToken

func WithToken(token string) Options

WithToken sets 1password connect api token.

func WithURL

func WithURL(url string) Options

WithURL sets 1password connect api server url.

func WithVault

func WithVault(uuid string) Options

WithVault changes the vault from the default vault (Dev) to uuid.

func WithVaultTitle

func WithVaultTitle(title string) Options

WithVaultTitle is equivalent to WithVault except it searches by title.

Jump to

Keyboard shortcuts

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