opclient

package
v0.0.1-0...-ff937d3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright © 2022 Roberto Hidalgo <joao@un.rob.mx> SPDX-License-Identifier: Apache-2.0

Copyright © 2022 Roberto Hidalgo <joao@un.rob.mx> SPDX-License-Identifier: Apache-2.0

Copyright © 2022 Roberto Hidalgo <joao@un.rob.mx> SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const UUIDLength = 26

UUIDLength defines the required length of UUIDs.

Variables

View Source
var ConnectClientFactory func(host, token, userAgent string) connect.Client = connect.NewClientWithUserAgent
View Source
var Path = "op"

Path points to the op binary.

Functions

func Checksum

func Checksum(fields []*op.ItemField) string

func DefaultExec

func DefaultExec(program string, args []string, stdin *bytes.Buffer) (stdout bytes.Buffer, err error)

func Get

func Get(vault, name string) (*op.Item, error)

func IsValidClientUUID

func IsValidClientUUID(uuid string) bool

IsValidClientUUID returns true if the given client uuid is valid.

func ItemMissingError

func ItemMissingError(name string, err error) bool

func List

func List(vault, prefix string) ([]string, error)

func Update

func Update(vault, name string, item *op.Item) error

func Use

func Use(newClient opClient)

Types

type CLI

type CLI struct {
	DryRun bool // Won't write to 1Password
}

func (*CLI) Create

func (b *CLI) Create(vault string, item *op.Item) error

func (*CLI) DeprecatedUpdate

func (b *CLI) DeprecatedUpdate(updated *op.Item, original *op.Item) error

func (*CLI) Get

func (b *CLI) Get(vault, name string) (*op.Item, error)

func (*CLI) List

func (b *CLI) List(vault, prefix string) ([]string, error)

func (*CLI) Update

func (b *CLI) Update(item *op.Item, remote *op.Item) error

func (*CLI) UpdateModern

func (b *CLI) UpdateModern(updated *op.Item, original *op.Item) error

type Connect

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

func NewConnect

func NewConnect(host, token string) *Connect

func (*Connect) Create

func (b *Connect) Create(vault string, item *op.Item) error

func (*Connect) Get

func (b *Connect) Get(vault, name string) (*op.Item, error)

func (*Connect) List

func (b *Connect) List(vault, prefix string) ([]string, error)

func (*Connect) Update

func (b *Connect) Update(item *op.Item, remote *op.Item) error

type ExecFunc

type ExecFunc func(program string, args []string, stdin *bytes.Buffer) (bytes.Buffer, error)
var Exec ExecFunc = DefaultExec

Jump to

Keyboard shortcuts

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