connect

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 19 Imported by: 29

Documentation

Index

Constants

View Source
const SDKVersion = "1.5.3"

SDKVersion is the latest Semantic Version of the library Do not rename this variable without changing the regex in the Makefile

View Source
const VersionHeaderKey = "1Password-Connect-Version"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetVaults() ([]onepassword.Vault, error)
	GetVault(uuid string) (*onepassword.Vault, error)
	GetVaultByUUID(uuid string) (*onepassword.Vault, error)
	GetVaultByTitle(title string) (*onepassword.Vault, error)
	GetVaultsByTitle(uuid string) ([]onepassword.Vault, error)
	GetItems(vaultQuery string) ([]onepassword.Item, error)
	GetItem(itemQuery, vaultQuery string) (*onepassword.Item, error)
	GetItemByUUID(uuid string, vaultQuery string) (*onepassword.Item, error)
	GetItemByTitle(title string, vaultQuery string) (*onepassword.Item, error)
	GetItemsByTitle(title string, vaultQuery string) ([]onepassword.Item, error)
	CreateItem(item *onepassword.Item, vaultQuery string) (*onepassword.Item, error)
	UpdateItem(item *onepassword.Item, vaultQuery string) (*onepassword.Item, error)
	DeleteItem(item *onepassword.Item, vaultQuery string) error
	DeleteItemByID(itemUUID string, vaultQuery string) error
	DeleteItemByTitle(title string, vaultQuery string) error
	GetFiles(itemQuery string, vaultQuery string) ([]onepassword.File, error)
	GetFile(uuid string, itemQuery string, vaultQuery string) (*onepassword.File, error)
	GetFileContent(file *onepassword.File) ([]byte, error)
	DownloadFile(file *onepassword.File, targetDirectory string, overwrite bool) (string, error)
	LoadStructFromItemByUUID(config interface{}, itemUUID string, vaultQuery string) error
	LoadStructFromItemByTitle(config interface{}, itemTitle string, vaultQuery string) error
	LoadStructFromItem(config interface{}, itemQuery string, vaultQuery string) error
	LoadStruct(config interface{}) error
}

Client Represents an available 1Password Connect API to connect to

func NewClient

func NewClient(url string, token string) Client

NewClient Returns a Secret Service client for a given url and jwt

func NewClientFromEnvironment

func NewClientFromEnvironment() (Client, error)

NewClientFromEnvironment Returns a Secret Service client assuming that your jwt is set in the OP_TOKEN environment variable

func NewClientWithUserAgent

func NewClientWithUserAgent(url string, token string, userAgent string) Client

NewClientWithUserAgent Returns a Secret Service client for a given url and jwt and identifies with userAgent

Jump to

Keyboard shortcuts

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