Documentation
¶
Index ¶
Constants ¶
View Source
const (
DateLayout = "2006-01-02T15:04:05.000Z"
)
View Source
const (
DefaultBitwardenServerURL = "https://vault.bitwarden.com"
)
Variables ¶
View Source
var ( ErrObjectNotFound = errors.New("object not found") ErrAttachmentNotFound = errors.New("attachment not found") )
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(Object) (*Object, error) GetSessionKey() string HasSessionKey() bool ListObjects(objType string, options ...ListObjectsOption) ([]Object, error) LoginWithAPIKey(password, clientId, clientSecret string) error LoginWithPassword(username, password string) error Logout() error DeleteAttachment(itemId, attachmentId string) error DeleteObject(Object) error SetServer(string) error SetSessionKey(string) Status() (*Status, error) Sync() error Unlock(password string) error }
type ListObjectsOption ¶ added in v0.8.0
type ListObjectsOption func(args *[]string)
func WithCollectionID ¶ added in v0.8.0
func WithCollectionID(id string) ListObjectsOption
func WithFolderID ¶ added in v0.8.0
func WithFolderID(id string) ListObjectsOption
func WithOrganizationID ¶ added in v0.8.0
func WithOrganizationID(id string) ListObjectsOption
func WithSearch ¶ added in v0.8.0
func WithSearch(search string) ListObjectsOption
func WithUrl ¶ added in v0.8.0
func WithUrl(url string) ListObjectsOption
type ListObjectsOptionGenerator ¶ added in v0.8.0
type ListObjectsOptionGenerator func(id string) ListObjectsOption
type Object ¶
type Object struct { CollectionIds []string `json:"collectionIds,omitempty"` CreationDate *time.Time `json:"creationDate,omitempty"` DeletedDate *time.Time `json:"deletedDate,omitempty"` ID string `json:"id,omitempty"` ExternalID string `json:"externalId,omitempty"` FolderID string `json:"folderId,omitempty"` Groups []interface{} `json:"groups"` // Not implemented yet 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"` }
func FilterObjectsByType ¶ added in v0.8.0
type ObjectType ¶
type ObjectType string
const ( ObjectTypeItem ObjectType = "item" ObjectTypeAttachment ObjectType = "attachment" ObjectTypeFolder ObjectType = "folder" ObjectTypeOrgCollection ObjectType = "org-collection" ObjectTypeOrganization ObjectType = "organization" )
type Options ¶
type Options func(c Client)
func DisableRetryBackoff ¶ added in v0.6.0
func DisableRetryBackoff() Options
func DisableSync ¶
func DisableSync() Options
func WithAppDataDir ¶
func WithExtraCACertsPath ¶ added in v0.7.0
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.