// Channels returns a list of your channels
Channels returns a list of your channels
// Channels returns a list of your channels
func (c *Client) Channels() ([]*Channel, error) {
	req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/channels", baseURL), nil)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("X-Authorization", c.config.key)
	req.Header.Add("X-UserId", c.config.userID)
	resp, err := c.httpClient.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	content, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	channels := new(channelsResult)
	json.Unmarshal(content, channels)
	return channels.Data, nil
}
func ( c * Client ) Channels ( ) ( [ ] * Channel , error ) { req , err := http . NewRequest ( http . MethodGet , fmt . Sprintf ( " " , baseURL ) , nil ) if err != nil { return nil , err } req . Header . Add ( " " , " " ) req . Header . Add ( " " , c . config . key ) req . Header . Add ( " " , c . config . userID ) resp , err := c . httpClient . Do ( req ) if err != nil { return nil , err } defer resp . Body . Close ( ) content , err := ioutil . ReadAll ( resp . Body ) if err != nil { return nil , err } channels := new ( channelsResult ) json . Unmarshal ( content , channels ) return channels . Data , nil }
Channels returns a list of your channels
Channels returns a list of your channels