Documentation ¶
Overview ¶
bitwarden implements an API client for bitwarden
References:
https://github.com/jcs/rubywarden/blob/master/API.md https://github.com/mvdan/bitw/blob/master/auth.go https://github.com/philhug/bitwarden-client-go
bitwarden implements an API client for bitwarden
Index ¶
- func OptCredentials(clientId, secret string) client.ClientOpt
- func OptDevice(device schema.Device) client.ClientOpt
- func OptFileStorage(cachePath string) client.ClientOpt
- func OptStorage(v Storage) client.ClientOpt
- type Client
- func (c *Client) Ciphers(opts ...RequestOpt) (schema.Iterator[*schema.Cipher], error)
- func (c *Client) Folders(opts ...RequestOpt) (schema.Iterator[*schema.Folder], error)
- func (c *Client) Login(opts ...RequestOpt) error
- func (c *Client) Session() *schema.Session
- func (c *Client) Sync(opts ...RequestOpt) (*schema.Profile, error)
- type Login
- type RequestOpt
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptCredentials ¶ added in v1.0.1
Set the client_id and client_secret
func OptFileStorage ¶ added in v1.0.2
Use file storage engine to read and write data
func OptStorage ¶ added in v1.0.2
Use a storage engine to read and write data
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Login ¶
func (c *Client) Login(opts ...RequestOpt) error
Login sets the session token. Use OptForce to request token even if there is a valid token
type RequestOpt ¶ added in v1.0.2
type RequestOpt func(*opt) error
type Storage ¶ added in v1.0.2
type Storage interface { // Read the session from storage a session id, returns nil if there is no session ReadSession() (*schema.Session, error) // Write the session to storage WriteSession(*schema.Session) error // Read the profile from storage ReadProfile() (*schema.Profile, error) // Write the profile to storage WriteProfile(*schema.Profile) error // Write the folders to storage WriteFolders(schema.Folders) error // Write the ciphers to storage WriteCiphers(schema.Ciphers) error // Read all ciphers and return an iterator ReadCiphers() (schema.Iterator[*schema.Cipher], error) // Read all folders and return an iterator ReadFolders() (schema.Iterator[*schema.Folder], error) }
Storage is an interface for reading and writing session, profile, folder and cipher information
Click to show internal directories.
Click to hide internal directories.