op

package module
v0.0.0-...-9673488 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDocument

func CreateDocument(op OpFunc, input DocumentUpsert) (string, error)

CreateDocument creates a new 1Passord document and returns the created login's uuid on success.

func CreateVault

func CreateVault(op OpFunc, input CreateVaultMutation) (string, error)

CreateVault creates a new 1Passord vault and returns the newly created vault's uuid on success.

func DeleteDocument

func DeleteDocument(op OpFunc, input Query) error

DeleteDocument deletes any document by uuid, name, etc.

func EditDocument

func EditDocument(op OpFunc, input DocumentUpsert) (string, error)

EditDocument edits a 1Passord document by uuid, name, etc. and returns the edited login's uuid on success.

func GetDocument

func GetDocument(op OpFunc, input Query) (string, error)

GetDocument wraps "op get document" and captures stdout/stderr

func GetItem

func GetItem(op OpFunc, input Query) (string, error)

GetItem wraps "op get item" and captures stdout/stderr

func GetVault

func GetVault(op OpFunc, input Query) (string, error)

GetVault wraps "op get vault" and captures stdout/stderr

func Op

func Op(stdin string, args []string) (string, error)

Op wraps 1Password's cli tool op.

func ShouldClearSessionAndRetry

func ShouldClearSessionAndRetry(err error) bool

ShouldClearSessionAndRetry

func Signin

func Signin(op OpFunc) (string, error)

Signin requests the user to sign into 1Password through stdin, then returns the provided session token.

Types

type Context

type Context struct {
	SessionToken string
	VaultUUID    string
}

type CreateVaultMutation

type CreateVaultMutation struct {
	AllowAdminsToManage bool
	Description         string
	SessionToken        string
	Title               string
}

type DocumentUpsert

type DocumentUpsert struct {
	Query
	Content  string
	FileName string
	Title    string
}

type OpFunc

type OpFunc func(stdin string, args []string) (string, error)

type Query

type Query struct {
	Context
	Key string // can be a title, uuid, etc.
}

Jump to

Keyboard shortcuts

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