...
1
2
3
4
5
6 package github
7
8 import "context"
9
10
11
12
13
14 type ActivityService service
15
16
17 type FeedLink struct {
18 HRef *string `json:"href,omitempty"`
19 Type *string `json:"type,omitempty"`
20 }
21
22
23 type Feeds struct {
24 TimelineURL *string `json:"timeline_url,omitempty"`
25 UserURL *string `json:"user_url,omitempty"`
26 CurrentUserPublicURL *string `json:"current_user_public_url,omitempty"`
27 CurrentUserURL *string `json:"current_user_url,omitempty"`
28 CurrentUserActorURL *string `json:"current_user_actor_url,omitempty"`
29 CurrentUserOrganizationURL *string `json:"current_user_organization_url,omitempty"`
30 CurrentUserOrganizationURLs []string `json:"current_user_organization_urls,omitempty"`
31 Links *struct {
32 Timeline *FeedLink `json:"timeline,omitempty"`
33 User *FeedLink `json:"user,omitempty"`
34 CurrentUserPublic *FeedLink `json:"current_user_public,omitempty"`
35 CurrentUser *FeedLink `json:"current_user,omitempty"`
36 CurrentUserActor *FeedLink `json:"current_user_actor,omitempty"`
37 CurrentUserOrganization *FeedLink `json:"current_user_organization,omitempty"`
38 CurrentUserOrganizations []*FeedLink `json:"current_user_organizations,omitempty"`
39 } `json:"_links,omitempty"`
40 }
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) {
57 req, err := s.client.NewRequest("GET", "feeds", nil)
58 if err != nil {
59 return nil, nil, err
60 }
61
62 f := &Feeds{}
63 resp, err := s.client.Do(ctx, req, f)
64 if err != nil {
65 return nil, resp, err
66 }
67
68 return f, resp, nil
69 }
70
View as plain text