Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDeviceIdentifier ¶
func MakeDeviceIdentifier() string
MakeDeviceIdentifier creates a randomly-assigned device identifier
Types ¶
type Cipher ¶
type Cipher struct {
Id string `json:"id,width:36"`
Name string `json:"name,width:30"`
Type CipherType `json:"type,width:5"`
FolderId string `json:"folderId,omitempty,width:36"`
OrganizationId string `json:"organizationId,omitempty,width:36"`
Favorite bool `json:"favorite,omitempty,width:5"`
Edit bool `json:"edit,width:5"`
RevisionDate time.Time `json:"revisionDate,width:29"`
CollectionIds []string `json:"collectionIds,omitempty"`
ViewPassword bool `json:"viewPassword,width:5"`
Login *CipherLogin `json:"Login,omitempty,wrap"`
// Card *CardData `json:"Card,omitempty"`
// SecureNote *SecureNoteData `json:"SecureNote,omitempty"`
// Identity *IdentityData `json:"Identity,omitempty"`
Attachments []string `json:"Attachments,omitempty"`
Object string `json:"object"`
}
type CipherLogin ¶
type CipherType ¶
type CipherType uint
const ( CipherTypeLogin CipherType CipherTypeNote CipherTypeCard CipherTypeIdentity )
func (CipherType) Marshal ¶
func (t CipherType) Marshal() ([]byte, error)
func (CipherType) String ¶
func (t CipherType) String() string
type Device ¶
type Device struct {
Name string `json:"deviceName"`
Identifier string `json:"deviceIdentifier,omitempty"`
Type DeviceType `json:"deviceType,omitempty"`
PushToken string `json:"devicePushToken,omitempty"`
}
Device represents a device
func NewDeviceEx ¶
func NewDeviceEx(deviceType DeviceType, deviceIdentifier, name, pushToken string) *Device
Return a new device with a known identifier and type
type DeviceType ¶
type DeviceType uint
const ( Android DeviceType = iota ChromeExtension FirefoxExtension OperaExtension EdgeExtension WindowsDesktop MacOsDesktop LinuxDesktop ChromeBrowser FirefoxBrowser OperaBrowser EdgeBrowser IEBrowser UnknownBrowser AndroidAmazon UWP SafariBrowser VivaldiBrowser VivaldiExtension SafariExtension )
func MakeDeviceType ¶
func MakeDeviceType() DeviceType
MakeDeviceType returns the device type for the current runtime
type Folder ¶
type Folder struct {
Id string `json:"id,width:36"`
Name string `json:"name"` // Encrypted
RevisionDate time.Time `json:"revisionDate,width:29"`
Object string `json:"object,width:6"`
}
type Iterator ¶ added in v1.0.2
type Iterator[T Iterable] interface { // Return next value or nil if there are no more values Next() T // Compute and return the encryption/decryption key from the profile, // password and KDF parameters CryptKey(*Profile, string, Kdf) (*crypto.CryptoKey, error) // CanCrypt returns true if the iterator has a key // for encryption and decryption CanCrypt() bool // Decrypt the value and return a copy of it Decrypt(T) (T, error) }
Iterate over values
func NewIterator ¶ added in v1.0.2
NewIterator returns a new iterator which can be used to iterate over values
type Organization ¶
type Organization struct {
Id string `json:"id"`
Name string `json:"name"`
Status uint `json:"status"`
Type uint `json:"type"`
Enabled bool `json:"enabled"`
Identifier string `json:"identifier"`
UserId string `json:"userId"`
Object string `json:"object"`
}
func (Organization) String ¶
func (o Organization) String() string
type Profile ¶
type Profile struct {
Id string `json:"id" writer:",width:36"`
Name string `json:"name"`
Email string `json:"email"`
EmailVerified bool `json:"emailVerified" writer:",width:5,right,omitempty"`
Key string `json:"key" writer:",wrap,omitempty"`
Premium bool `json:"premium" writer:",width:5,right,omitempty"`
PremiumFromOrganization bool `json:"premiumFromOrganization" writer:",width:5,right,omitempty"`
Culture string `json:"culture" writer:",width:5,right,omitempty"`
TwoFactorEnabled bool `json:"twoFactorEnabled" writer:",width:5,right,omitempty"`
SecurityStamp *string `json:"securityStamp" writer:",width:5,right,omitempty"`
ForcePasswordReset bool `json:"forcePasswordReset" writer:",width:5,right,omitempty"`
UsesKeyConnector bool `json:"usesKeyConnector" writer:",width:5,right,omitempty"`
Organizations []*Organization `json:"organizations,omitempty"`
Object string `json:"object" writer:"-"`
}
func NewProfile ¶
func NewProfile() *Profile
type ReaderWriter ¶
type Session ¶
type Session struct {
// Device identifier
Device *Device `json:"device,omitempty,wrap"`
// Login Token
Token *Token `json:"token,omitempty,wrap"`
// Encryption parameters
Kdf
}
Session represents a long-running session with the Bitwarden server
Click to show internal directories.
Click to hide internal directories.