Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultBitwardenServerURL = "https://vault.bitwarden.com"
)
View Source
const (
RevisionDateLayout = "2006-01-02T15:04:05.000Z"
)
Variables ¶
View Source
var ( ErrObjectNotFound = errObjectNotFound() ErrAttachmentNotFound = errAttachmentNotFound() )
Functions ¶
This section is empty.
Types ¶
type Attachment ¶ added in v0.5.0
type Client ¶
type Client interface { CreateAttachment(itemId, filePath string) (*Object, error) CreateObject(Object) (*Object, error) EditObject(Object) (*Object, error) GetAttachment(itemId, attachmentId string) ([]byte, error) GetObject(objType, itemId string) (*Object, error) HasSessionKey() bool LoginWithAPIKey(password, clientId, clientSecret string) error LoginWithPassword(username, password string) error Logout() error DeleteAttachment(itemId, attachmentId string) error DeleteObject(objType, itemId string) error SetServer(string) error SetSessionKey(string) Status() (*Status, error) Sync() error Unlock(password string) error }
type Object ¶
type Object struct { CollectionIds []string `json:"collectionIds,omitempty"` ID string `json:"id,omitempty"` ExternalID string `json:"externalId,omitempty"` FolderID string `json:"folderId,omitempty"` Login Login `json:"login,omitempty"` Name string `json:"name,omitempty"` Notes string `json:"notes,omitempty"` Object ObjectType `json:"object,omitempty"` OrganizationID string `json:"organizationId,omitempty"` SecureNote SecureNote `json:"secureNote,omitempty"` Type ItemType `json:"type,omitempty"` Fields []Field `json:"fields,omitempty"` Reprompt int `json:"reprompt,omitempty"` Favorite bool `json:"favorite,omitempty"` RevisionDate *time.Time `json:"revisionDate,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
type ObjectType ¶
type ObjectType string
const ( ObjectTypeItem ObjectType = "item" ObjectTypeAttachment ObjectType = "attachment" ObjectTypeFolder ObjectType = "folder" )
type Options ¶
type Options func(c Client)
func DisableRetryBackoff ¶ added in v0.6.0
func DisableRetryBackoff() Options
func DisableSync ¶
func DisableSync() Options
func WithAppDataDir ¶
type SecureNote ¶
type SecureNote struct {
Type int `json:"type,omitempty"`
}
type Status ¶
type Status struct { ServerURL string `json:"serverURL,omitempty"` LastSync time.Time `json:"lastSync,omitempty"` UserEmail string `json:"userEmail,omitempty"` UserID string `json:"userID,omitempty"` Status VaultStatus `json:"status,omitempty"` }
func (*Status) VaultFromServer ¶ added in v0.3.2
func (*Status) VaultOfUser ¶ added in v0.3.2
type VaultStatus ¶
type VaultStatus string
const ( StatusLocked VaultStatus = "locked" StatusUnauthenticated VaultStatus = "unauthenticated" StatusUnlocked VaultStatus = "unlocked" )
Click to show internal directories.
Click to hide internal directories.