// GetActivities returns an iterator that reads activities at the given IRI. The IRI may reference a
// Collection, OrderedCollection, CollectionPage, or OrderedCollectionPage.
GetActivities returns an iterator that reads activities at the given IRI. The IRI may reference a
Collection, OrderedCollection, CollectionPage, or OrderedCollectionPage.
// GetActivities returns an iterator that reads activities at the given IRI . The IRI may reference a // Collection OrderedCollection CollectionPage or OrderedCollectionPage .
func (c *Client) GetActivities(iri *url.URL, order Order) (ActivityIterator, error) {
	respBytes, err := c.get(iri)
	if err != nil {
		return nil, fmt.Errorf("error reading response from %s: %w", iri, err)
	}
	logger.Debugf("Got response from %s: %s", iri, respBytes)
	obj := &vocab.ObjectType{}
	err = json.Unmarshal(respBytes, &obj)
	if err != nil {
		return nil, err
	}
	switch {
	case obj.Type().IsAny(vocab.TypeCollection, vocab.TypeOrderedCollection):
		return c.activityIteratorFromCollection(respBytes, order)
	case obj.Type().IsAny(vocab.TypeCollectionPage, vocab.TypeOrderedCollectionPage):
		return c.activityIteratorFromCollectionPage(respBytes, order)
	default:
		return nil, fmt.Errorf("invalid collection type %s", obj.Type())
	}
}
func ( c * Client ) GetActivities ( iri * url . URL , order Order ) ( ActivityIterator , error ) { respBytes , err := c . get ( iri ) if err != nil { return nil , fmt . Errorf ( " " , iri , err ) } logger . Debugf ( " " , iri , respBytes ) obj := & vocab . ObjectType { } err = json . Unmarshal ( respBytes , & obj ) if err != nil { return nil , err } switch { case obj . Type ( ) . IsAny ( vocab . TypeCollection , vocab . TypeOrderedCollection ) : return c . activityIteratorFromCollection ( respBytes , order ) case obj . Type ( ) . IsAny ( vocab . TypeCollectionPage , vocab . TypeOrderedCollectionPage ) : return c . activityIteratorFromCollectionPage ( respBytes , order ) default : return nil , fmt . Errorf ( " " , obj . Type ( ) ) } }
GetActivities returns an iterator that reads activities at the given IRI.
GetActivities returns an iterator that reads activities at the given IRI .