Documentation ¶
Index ¶
- Variables
- func GetSalt(user string) (session *sessionStart, err error)
- func IsAPIError(err error) bool
- type Basics
- type Email
- type Emails
- type InvitationStats
- type Key
- type KeyType
- type Profile
- type Proof
- type Session
- func (s *Session) AddKey(pub string) (kid string, err error)
- func (s *Session) DeleteKey(kid string) (err error)
- func (s *Session) GithubGetAuth(username string) (authData []byte, err error)
- func (s *Session) NextSequence() (seqNum int, prev string, err error)
- func (s *Session) ServicePostAuth(sig []byte, user, service string) (proof *Proof, err error)
- func (s *Session) SignaturePostAuth(sig []byte) (authToken []byte, err error)
- func (s *Session) SignaturePostAuthData() (msg []byte, err error)
- func (s *Session) TwitterGetAuth(username string) (authData []byte, err error)
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrNoPublicKey = fmt.Errorf("api: no public key for user")
Functions ¶
func GetSalt ¶
GetSalt retrieves a salt for the named user. It returns a session start, which should only be passed to Login.
func IsAPIError ¶
IsAPIError returns true if the error is from the Keybase API (and not a network / JSON / etc error).
Types ¶
type Basics ¶
type Basics struct { Username string `json:"username"` Created int `json:"ctime"` Modified int `json:"mtime"` IDVersion int `json:"id_version"` TrackVersion int `json:"track_version"` LastIDChange int `json:"last_id_change"` Salt string `json:"string"` }
Basics contain basic information about the user.
type Emails ¶
type Emails struct {
Primary Email `json:"primary"`
}
Emails contains a list of the user's emails. Right now, only a primary email is contained in this structure.
type InvitationStats ¶
type InvitationStats struct { Available int `json:"available"` Used int `json:"used"` Power int `json:"power"` Open int `json:"open"` }
InvitationStats contains the user's invitation stats.
type Key ¶
type Key struct { KeyID string `json:"kid"` Fingerprint string `json:"key_fingerprint"` KeyType KeyType `json:"key_type"` Bundle string `json:"bundle"` Modified int `json:"mtime"` Created int `json:"ctime"` }
A Key contains information about a public or private key.
type Profile ¶
type Profile struct { Modified int `json:"mtime"` FullName string `json:"full_name"` Location string `json:"location"` Bio string `json:"bio"` }
Profile contains the user's profile information.
type Session ¶
type Session struct { Status *Status `json:"status"` GuestID string `json:"guest_id"` Session string `json:"session"` UID string `json:"uid"` User User `json:"me"` Token string `json:"csrf_token"` }
Session contains a keybase session, with user information.
func Login ¶
Login completes a login after a call to GetSalt. The session start value is destroyed once the function exits.
func (*Session) AddKey ¶
AddKey adds a new public key to the account. This will replace any existing accounts.
func (*Session) DeleteKey ¶
DeleteKey performs a simple delete "revocation" (in Keybase parlance): it will delete the key with the named key ID from the user's account.
func (*Session) GithubGetAuth ¶
func (*Session) NextSequence ¶
Retrieve the next sequence number for signatures.
func (*Session) ServicePostAuth ¶
func (*Session) SignaturePostAuth ¶
func (*Session) SignaturePostAuthData ¶
type User ¶
type User struct { ID string `json:"id"` Basics Basics `json:"basics"` Invitations InvitationStats `json:"invitation_stats"` Profile Profile `json:"profile"` Emails Emails `json:"emails"` PublicKeys map[string]*Key `json:"public_keys"` PrivateKeys map[string]*Key `json:"private_keys"` }
User contains information regarding a user.
func LookupUser ¶
LookupUser returns available user information for the named user.