Browse Source

add ListUserMemberships()

main
Sam 4 years ago
parent
commit
a37a0609eb
  1. 12
      team.go
  2. 26
      types.go

12
team.go

@ -175,3 +175,15 @@ func (k *Keybase) CreateTeam(name string) (TeamAPI, error) { @@ -175,3 +175,15 @@ func (k *Keybase) CreateTeam(name string) (TeamAPI, error) {
r, err := teamAPIOut(k, m)
return r, err
}
// ListUserMemberships returns information about a given user's team memberships
func (k *Keybase) ListUserMemberships(user string) (TeamAPI, error) {
m := TeamAPI{
Params: &tParams{},
}
m.Method = "list-user-memberships"
m.Params.Options.Username = user
r, err := teamAPIOut(k, m)
return r, err
}

26
types.go

@ -595,6 +595,31 @@ type tResult struct { @@ -595,6 +595,31 @@ type tResult struct {
AnnotatedActiveInvites annotatedActiveInvites `json:"annotatedActiveInvites"`
Settings settings `json:"settings"`
Showcase showcase `json:"showcase"`
Teams []teamInfo `json:"teams"`
}
type implicit struct {
Role int `json:"role"`
Ancestor string `json:"ancestor"`
}
type teamInfo struct {
UID string `json:"uid"`
TeamID string `json:"team_id"`
Username string `json:"username"`
FullName string `json:"full_name"`
FqName string `json:"fq_name"`
IsImplicitTeam bool `json:"is_implicit_team"`
ImplicitTeamDisplayName string `json:"implicit_team_display_name"`
IsOpenTeam bool `json:"is_open_team"`
Role int `json:"role"`
NeedsPUK bool `json:"needsPUK"`
MemberCount int `json:"member_count"`
MemberEldestSeqno int `json:"member_eldest_seqno"`
AllowProfilePromote bool `json:"allow_profile_promote"`
IsMemberShowcased bool `json:"is_member_showcased"`
Status int `json:"status"`
Implicit implicit `json:"implicit,omitempty"`
}
// UserAPI holds information received to the userlookup api
@ -748,6 +773,7 @@ type keybase interface { @@ -748,6 +773,7 @@ type keybase interface {
status() status
version() string
UserLookup(users ...string) (UserAPI, error)
ListUserMemberships(user string) (TeamAPI, error)
}
type status struct {

Loading…
Cancel
Save