Documentation
¶
Index ¶
- func LoadToken(remote string) (string, error)
- func SaveCredentials(remote string, credentials Credentials) error
- func SaveToken(remote, token string) error
- type Cipher
- type Client
- type Config
- type Credentials
- type DeviceCode
- type OAuth
- func (o OAuth) Refresh(ctx context.Context, clientID string, previous Credentials) (Credentials, error)
- func (o OAuth) Start(ctx context.Context, clientID string) (DeviceCode, error)
- func (o OAuth) Wait(ctx context.Context, clientID string, code DeviceCode) (string, error)
- func (o OAuth) WaitCredentials(ctx context.Context, clientID string, code DeviceCode) (Credentials, error)
- type Row
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveCredentials ¶
func SaveCredentials(remote string, credentials Credentials) error
Types ¶
type Cipher ¶
type Cipher struct {
Salt []byte
// contains filtered or unexported fields
}
Cipher holds a key derived on this device. Only its random salt may be shared.
func LoadCipher ¶
type Client ¶
type Client struct {
HTTP *http.Client
Config Config
Token string
TokenProvider func(context.Context) (string, error)
Cipher *Cipher
TraceDir string
DB *sql.DB
Blobs *blob.Store
}
type Config ¶
type Credentials ¶
type Credentials struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresAt int64 `json:"expires_at,omitempty"`
RefreshExpiresAt int64 `json:"refresh_expires_at,omitempty"`
}
func LoadCredentials ¶
func LoadCredentials(remote string) (Credentials, error)
type DeviceCode ¶
type OAuth ¶
func (OAuth) Refresh ¶
func (o OAuth) Refresh(ctx context.Context, clientID string, previous Credentials) (Credentials, error)
func (OAuth) WaitCredentials ¶
func (o OAuth) WaitCredentials(ctx context.Context, clientID string, code DeviceCode) (Credentials, error)
Click to show internal directories.
Click to hide internal directories.