Documentation
ΒΆ
Overview ΒΆ
AUTOGENERATED - DO NOT EDIT
AUTOGENERATED - DO NOT EDIT MANUALLY ΒΆ
AUTOGENERATED - DO NOT EDIT MANUALLY ΒΆ
Code generated by typeshare 1.9.2. DO NOT EDIT.
Index ΒΆ
- Constants
- type Client
- type ClientOption
- type Item
- type ItemCategory
- type ItemField
- type ItemFieldType
- type ItemSection
- type ItemsAPI
- type ItemsSource
- func (s ItemsSource) Create(ctx context.Context, item Item) (Item, error)
- func (s ItemsSource) Delete(ctx context.Context, vaultId string, itemId string) error
- func (s ItemsSource) Get(ctx context.Context, vaultId string, itemId string) (Item, error)
- func (s ItemsSource) Update(ctx context.Context, item Item) (Item, error)
- type SecretsAPI
- type SecretsSource
Constants ΒΆ
const ( DefaultIntegrationName = "Unknown" DefaultIntegrationVersion = "Unknown" )
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type Client ΒΆ
type Client struct { Secrets SecretsAPI Items ItemsAPI // contains filtered or unexported fields }
Client represents an instance of the 1Password Go SDK client.
type ClientOption ΒΆ
func WithIntegrationInfo ΒΆ
func WithIntegrationInfo(name string, version string) ClientOption
WithIntegrationInfo specifies the name and version of the integration built using the 1Password Go SDK. If you don't know which name and version to use, use `DefaultIntegrationName` and `DefaultIntegrationVersion`, respectively.
func WithServiceAccountToken ΒΆ
func WithServiceAccountToken(token string) ClientOption
WithServiceAccountToken specifies the [1Password Service Account](https://developer.1password.com/docs/service-accounts) token to use to authenticate the SDK client. Read more about how to get started with service accounts: https://developer.1password.com/docs/service-accounts/get-started/#create-a-service-account
type Item ΒΆ
type Item struct { // The item's unique ID ID string `json:"id"` // The item's title Title string `json:"title"` // The item's category Category ItemCategory `json:"category"` // The ID of the vault where the item is saved VaultID string `json:"vault_id"` // The item's fields Fields []ItemField `json:"fields"` // The item's sections Sections []ItemSection `json:"sections"` }
Represents a 1Password item.
type ItemCategory ΒΆ
type ItemCategory string
const ( ItemCategoryLogin ItemCategory = "Login" ItemCategorySecureNote ItemCategory = "SecureNote" ItemCategoryCreditCard ItemCategory = "CreditCard" ItemCategoryCryptoWallet ItemCategory = "CryptoWallet" ItemCategoryIdentity ItemCategory = "Identity" ItemCategoryPassword ItemCategory = "Password" ItemCategoryDocument ItemCategory = "Document" ItemCategoryApiCredentials ItemCategory = "ApiCredentials" ItemCategoryBankAccount ItemCategory = "BankAccount" ItemCategoryDatabase ItemCategory = "Database" ItemCategoryDriverLicense ItemCategory = "DriverLicense" ItemCategoryEmail ItemCategory = "Email" ItemCategoryMedicalRecord ItemCategory = "MedicalRecord" ItemCategoryMembership ItemCategory = "Membership" ItemCategoryOutdoorLicense ItemCategory = "OutdoorLicense" ItemCategoryPassport ItemCategory = "Passport" ItemCategoryRewards ItemCategory = "Rewards" ItemCategoryRouter ItemCategory = "Router" ItemCategoryServer ItemCategory = "Server" ItemCategorySshKey ItemCategory = "SshKey" ItemCategorySocialSecurityNumber ItemCategory = "SocialSecurityNumber" ItemCategorySoftwareLicense ItemCategory = "SoftwareLicense" ItemCategoryPerson ItemCategory = "Person" ItemCategoryUnsupported ItemCategory = "Unsupported" )
type ItemField ΒΆ
type ItemField struct { // The field's ID ID string `json:"id"` // The field's title Title string `json:"title"` // The ID of the section containing the field. Designated fields such as usernames and passwords don't need to specify a section. SectionID *string `json:"section_id,omitempty"` // The type of value stored in the field FieldType ItemFieldType `json:"field_type"` // The string representation of the field's value Value string `json:"value"` }
Stores a field's title and value.
type ItemFieldType ΒΆ
type ItemFieldType string
const ( ItemFieldTypeText ItemFieldType = "Text" ItemFieldTypeConcealed ItemFieldType = "Concealed" ItemFieldTypeUnsupported ItemFieldType = "Unsupported" )
type ItemSection ΒΆ
type ItemSection struct { // The section's ID ID string `json:"id"` // The section's name Title string `json:"title"` }
A section groups together multiple fields in an item.
type ItemsAPI ΒΆ
type ItemsAPI interface { // Create a new item Create(ctx context.Context, item Item) (Item, error) // Get an item by vault and item ID Get(ctx context.Context, vaultId string, itemId string) (Item, error) // Update an existing item. Warning: Only text and concealed fields are currently supported. Other fields will be permanently lost when you update an item. Update(ctx context.Context, item Item) (Item, error) // Delete an item. Warning: Information saved in fields other than text and concealed fields will be permanently lost. Delete(ctx context.Context, vaultId string, itemId string) error }
ItemsAPI contains all operations the SDK client can perform on 1Password items.
type ItemsSource ΒΆ
type ItemsSource struct {
internal.InnerClient
}
func NewItemsSource ΒΆ
func NewItemsSource(inner internal.InnerClient) *ItemsSource
type SecretsAPI ΒΆ
type SecretsAPI interface { // Resolve returns the secret the provided secret reference points to. // Secret references point to fields in 1Password. They have the following format: op://<vault-name>/<item-name>[/<section-name>]/<field-name> // Read more about secret references: https://developer.1password.com/docs/cli/secret-references Resolve(ctx context.Context, secretReference string) (string, error) }
type SecretsSource ΒΆ
type SecretsSource struct {
internal.InnerClient
}
func NewSecretsSource ΒΆ
func NewSecretsSource(inner internal.InnerClient) *SecretsSource
func (SecretsSource) Resolve ΒΆ
Resolve returns the secret the provided secret reference points to. Secret references point to fields in 1Password. They have the following format: op://<vault-name>/<item-name>[/<section-name>]/<field-name> Read more about secret references: https://developer.1password.com/docs/cli/secret-references