...
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 *FeedLinks `json:"_links,omitempty"`
32 }
33
34
35 type FeedLinks struct {
36 Timeline *FeedLink `json:"timeline,omitempty"`
37 User *FeedLink `json:"user,omitempty"`
38 CurrentUserPublic *FeedLink `json:"current_user_public,omitempty"`
39 CurrentUser *FeedLink `json:"current_user,omitempty"`
40 CurrentUserActor *FeedLink `json:"current_user_actor,omitempty"`
41 CurrentUserOrganization *FeedLink `json:"current_user_organization,omitempty"`
42 CurrentUserOrganizations []*FeedLink `json:"current_user_organizations,omitempty"`
43 }
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) {
61 req, err := s.client.NewRequest("GET", "feeds", nil)
62 if err != nil {
63 return nil, nil, err
64 }
65
66 f := &Feeds{}
67 resp, err := s.client.Do(ctx, req, f)
68 if err != nil {
69 return nil, resp, err
70 }
71
72 return f, resp, nil
73 }
74
View as plain text