| 24 | } |
| 25 | |
| 26 | func NewRepository( |
| 27 | ctx context.Context, |
| 28 | client *github.Client, |
| 29 | backoff *backoff.Backoff, |
| 30 | raw *github.Repository) (*Repository, error) { |
| 31 | // FIXME change to not use unmarshal w/ reflection or plain initializer |
| 32 | var stats types.RepoCoreStats |
| 33 | orgJson, _ := json.Marshal(raw) |
| 34 | _ = json.Unmarshal(orgJson, &stats) |
| 35 | |
| 36 | return &Repository{ |
| 37 | info: raw, |
| 38 | client: client, |
| 39 | backoff: backoff, |
| 40 | paginationSize: 100, |
| 41 | CoreStats: &stats, |
| 42 | }, nil |
| 43 | } |
| 44 | |
| 45 | func (repo *Repository) GetWebhooks( |
| 46 | ctx context.Context) (map[types.WebhookID]types.Webhook, error) { |