Versions in this module Expand all Collapse all v7 v7.0.5 Jul 14, 2022 v7.0.4 Jul 14, 2022 v7.0.3 Jul 14, 2022 Changes in this version + const HeaderRateLimit + const HeaderRateRemaining + const HeaderRateReset + const ReactionTimeLayout + const TimeLayout + var CreateCollectionReference = (&CollectionsClient{}).CreateReference + var CreateUserReference = (&UsersClient{}).CreateReference + var ErrInvalidNextPage = errors.New("invalid format for Next field") + var ErrMissingNextPage = errors.New("request missing next page") + var Version = "v7.0.1" + type APIError struct + Code int + Detail string + Duration Duration + Exception string + ExceptionFields map[string][]interface{} + Rate *Rate + StatusCode int + func ToAPIError(err error) (APIError, bool) + func (e APIError) Error() string + type Activity struct + Actor string + Extra map[string]interface{} + ForeignID string + ID string + Object string + Origin string + Score float64 + Target string + Time Time + To []string + Verb string + func (a *Activity) UnmarshalJSON(b []byte) error + func (a Activity) MarshalJSON() ([]byte, error) + type ActivityGroup struct + Activities []Activity + type AddActivitiesResponse struct + Activities []Activity + type AddActivityResponse struct + func (a *AddActivityResponse) UnmarshalJSON(buf []byte) error + type AddObjectOption func(*addCollectionRequest) + func WithUserID(userID string) AddObjectOption + type AddReactionRequestObject struct + ActivityID string + Data map[string]interface{} + ID string + Kind string + ParentID string + TargetFeeds []string + TargetFeedsExtraData map[string]interface{} + UserID string + type AddToManyRequest struct + Activity Activity + FeedIDs []string + type AggregatedFeed struct + func (f *AggregatedFeed) AddActivities(ctx context.Context, activities ...Activity) (*AddActivitiesResponse, error) + func (f *AggregatedFeed) AddActivity(ctx context.Context, activity Activity) (*AddActivityResponse, error) + func (f *AggregatedFeed) Follow(ctx context.Context, feed *FlatFeed, opts ...FollowFeedOption) (*BaseResponse, error) + func (f *AggregatedFeed) GetActivities(ctx context.Context, opts ...GetActivitiesOption) (*AggregatedFeedResponse, error) + func (f *AggregatedFeed) GetActivitiesWithRanking(ctx context.Context, ranking string, opts ...GetActivitiesOption) (*AggregatedFeedResponse, error) + func (f *AggregatedFeed) GetEnrichedActivities(ctx context.Context, opts ...GetActivitiesOption) (*EnrichedAggregatedFeedResponse, error) + func (f *AggregatedFeed) GetEnrichedActivitiesWithRanking(ctx context.Context, ranking string, opts ...GetActivitiesOption) (*EnrichedAggregatedFeedResponse, error) + func (f *AggregatedFeed) GetFollowing(ctx context.Context, opts ...FollowingOption) (*FollowingResponse, error) + func (f *AggregatedFeed) GetNextPageActivities(ctx context.Context, resp *AggregatedFeedResponse) (*AggregatedFeedResponse, error) + func (f *AggregatedFeed) GetNextPageEnrichedActivities(ctx context.Context, resp *EnrichedAggregatedFeedResponse) (*EnrichedAggregatedFeedResponse, error) + func (f *AggregatedFeed) ID() string + func (f *AggregatedFeed) RealtimeToken(readonly bool) string + func (f *AggregatedFeed) RemoveActivityByForeignID(ctx context.Context, foreignID string) (*RemoveActivityResponse, error) + func (f *AggregatedFeed) RemoveActivityByID(ctx context.Context, id string) (*RemoveActivityResponse, error) + func (f *AggregatedFeed) Slug() string + func (f *AggregatedFeed) Unfollow(ctx context.Context, target Feed, opts ...UnfollowOption) (*BaseResponse, error) + func (f *AggregatedFeed) UpdateToTargets(ctx context.Context, activity Activity, opts ...UpdateToTargetsOption) (*UpdateToTargetsResponse, error) + func (f *AggregatedFeed) UserID() string + type AggregatedFeedResponse struct + Results []ActivityGroup + type AnalyticsClient struct + func (c *AnalyticsClient) RedirectAndTrack(url string, events ...map[string]interface{}) (string, error) + func (c *AnalyticsClient) TrackEngagement(ctx context.Context, events ...EngagementEvent) (*BaseResponse, error) + func (c *AnalyticsClient) TrackImpression(ctx context.Context, eventsData ImpressionEventsData) (*BaseResponse, error) + type BaseResponse struct + type Client struct + func New(key, secret string, opts ...ClientOption) (*Client, error) + func NewFromEnv(extraOptions ...ClientOption) (*Client, error) + func (c *Client) AddToMany(ctx context.Context, activity Activity, feeds ...Feed) error + func (c *Client) AggregatedFeed(slug, userID string) (*AggregatedFeed, error) + func (c *Client) Analytics() *AnalyticsClient + func (c *Client) Collections() *CollectionsClient + func (c *Client) CreateUserToken(userID string) (string, error) + func (c *Client) CreateUserTokenWithClaims(userID string, claims map[string]interface{}) (string, error) + func (c *Client) FlatFeed(slug, userID string) (*FlatFeed, error) + func (c *Client) FollowMany(ctx context.Context, relationships []FollowRelationship, ...) error + func (c *Client) GenericFeed(targetID string) (Feed, error) + func (c *Client) GetActivitiesByForeignID(ctx context.Context, values ...ForeignIDTimePair) (*GetActivitiesResponse, error) + func (c *Client) GetActivitiesByID(ctx context.Context, ids ...string) (*GetActivitiesResponse, error) + func (c *Client) GetEnrichedActivitiesByForeignID(ctx context.Context, values []ForeignIDTimePair, opts ...GetActivitiesOption) (*GetEnrichedActivitiesResponse, error) + func (c *Client) GetEnrichedActivitiesByID(ctx context.Context, ids []string, opts ...GetActivitiesOption) (*GetEnrichedActivitiesResponse, error) + func (c *Client) NotificationFeed(slug, userID string) (*NotificationFeed, error) + func (c *Client) PartialUpdateActivities(ctx context.Context, changesets ...UpdateActivityRequest) (*UpdateActivitiesResponse, error) + func (c *Client) Personalization() *PersonalizationClient + func (c *Client) Reactions() *ReactionsClient + func (c *Client) UnfollowMany(ctx context.Context, relationships []UnfollowRelationship) error + func (c *Client) UpdateActivities(ctx context.Context, activities ...Activity) (*BaseResponse, error) + func (c *Client) UpdateActivityByForeignID(ctx context.Context, foreignID string, timestamp Time, ...) (*UpdateActivityResponse, error) + func (c *Client) UpdateActivityByID(ctx context.Context, id string, set map[string]interface{}, unset []string) (*UpdateActivityResponse, error) + func (c *Client) Users() *UsersClient + func (c *Client) WithTimeout(timeout time.Duration) *Client + type ClientOption func(*Client) + func WithAPIRegion(region string) ClientOption + func WithAPIVersion(version string) ClientOption + func WithHTTPRequester(requester Requester) ClientOption + func WithTimeout(dur time.Duration) ClientOption + type CollectionObject struct + Data map[string]interface{} + ID string + func (o CollectionObject) MarshalJSON() ([]byte, error) + type CollectionObjectResponse struct + type CollectionsClient struct + func (c *CollectionsClient) Add(ctx context.Context, collection string, object CollectionObject, ...) (*CollectionObjectResponse, error) + func (c *CollectionsClient) CreateReference(collection, id string) string + func (c *CollectionsClient) Delete(ctx context.Context, collection, id string) (*BaseResponse, error) + func (c *CollectionsClient) DeleteMany(ctx context.Context, collection string, ids ...string) (*BaseResponse, error) + func (c *CollectionsClient) Get(ctx context.Context, collection, id string) (*CollectionObjectResponse, error) + func (c *CollectionsClient) Select(ctx context.Context, collection string, ids ...string) (*GetCollectionResponse, error) + func (c *CollectionsClient) Update(ctx context.Context, collection, id string, data map[string]interface{}) (*CollectionObjectResponse, error) + func (c *CollectionsClient) Upsert(ctx context.Context, collection string, objects ...CollectionObject) (*BaseResponse, error) + type Data struct + Extra map[string]interface{} + ID string + func (a Data) MarshalJSON() ([]byte, error) + type Duration struct + func (d *Duration) UnmarshalJSON(b []byte) error + func (d Duration) MarshalJSON() ([]byte, error) + type EngagementEvent map[string]interface + func (e EngagementEvent) WithBoost(boost int) EngagementEvent + func (e EngagementEvent) WithContent(foreignID string, content map[string]interface{}) EngagementEvent + func (e EngagementEvent) WithFeatures(features ...EventFeature) EngagementEvent + func (e EngagementEvent) WithFeedID(feedID string) EngagementEvent + func (e EngagementEvent) WithForeignID(foreignID string) EngagementEvent + func (e EngagementEvent) WithLabel(label string) EngagementEvent + func (e EngagementEvent) WithLocation(location string) EngagementEvent + func (e EngagementEvent) WithPosition(position int) EngagementEvent + func (e EngagementEvent) WithTrackedAt(trackedAt time.Time) EngagementEvent + func (e EngagementEvent) WithUserData(userData *UserData) EngagementEvent + type EnrichedActivity struct + Actor Data + Extra map[string]interface{} + ForeignID string + ID string + LatestReactions map[string][]*EnrichedReaction + Object Data + Origin Data + OwnReactions map[string][]*EnrichedReaction + ReactionCounts map[string]int + Score float64 + Target Data + Time Time + To []string + Verb string + func (a *EnrichedActivity) UnmarshalJSON(b []byte) error + func (a EnrichedActivity) MarshalJSON() ([]byte, error) + type EnrichedActivityGroup struct + Activities []EnrichedActivity + Score float64 + type EnrichedAggregatedFeedResponse struct + Results []EnrichedActivityGroup + type EnrichedFlatFeedResponse struct + Results []EnrichedActivity + type EnrichedNotificationFeedResponse struct + Results []EnrichedNotificationFeedResult + type EnrichedNotificationFeedResult struct + Activities []EnrichedActivity + type EnrichedReaction struct + ActivityID string + ChildrenCounters map[string]int + ChildrenReactions map[string][]*EnrichedReaction + CreatedAt Time + Data map[string]interface{} + ID string + Kind string + OwnChildren map[string][]*EnrichedReaction + ParentID string + TargetFeeds []string + UpdatedAt Time + User Data + UserID string + type EventFeature struct + Group string + Value string + func NewEventFeature(group, value string) EventFeature + type Feed interface + AddActivities func(context.Context, ...Activity) (*AddActivitiesResponse, error) + AddActivity func(context.Context, Activity) (*AddActivityResponse, error) + Follow func(context.Context, *FlatFeed, ...FollowFeedOption) (*BaseResponse, error) + GetFollowing func(context.Context, ...FollowingOption) (*FollowingResponse, error) + ID func() string + RealtimeToken func(bool) string + RemoveActivityByForeignID func(context.Context, string) (*RemoveActivityResponse, error) + RemoveActivityByID func(context.Context, string) (*RemoveActivityResponse, error) + Slug func() string + Unfollow func(context.Context, Feed, ...UnfollowOption) (*BaseResponse, error) + UpdateToTargets func(context.Context, Activity, ...UpdateToTargetsOption) (*UpdateToTargetsResponse, error) + UserID func() string + type FilterReactionResponse struct + Activity map[string]interface{} + Results []Reaction + type FilterReactionsAttribute func() string + func ByActivityID(activityID string) FilterReactionsAttribute + func ByReactionID(reactionID string) FilterReactionsAttribute + func ByUserID(userID string) FilterReactionsAttribute + func (a FilterReactionsAttribute) ByKind(kind string) FilterReactionsAttribute + type FilterReactionsOption struct + func WithActivityData() FilterReactionsOption + func WithChildrenUserID(userID string) FilterReactionsOption + func WithIDGT(id string) FilterReactionsOption + func WithIDGTE(id string) FilterReactionsOption + func WithIDLT(id string) FilterReactionsOption + func WithIDLTE(id string) FilterReactionsOption + func WithLimit(limit int) FilterReactionsOption + func WithOwnChildren() FilterReactionsOption + func WithOwnUserID(userID string) FilterReactionsOption + type FlatFeed struct + func (f *FlatFeed) AddActivities(ctx context.Context, activities ...Activity) (*AddActivitiesResponse, error) + func (f *FlatFeed) AddActivity(ctx context.Context, activity Activity) (*AddActivityResponse, error) + func (f *FlatFeed) Follow(ctx context.Context, feed *FlatFeed, opts ...FollowFeedOption) (*BaseResponse, error) + func (f *FlatFeed) FollowStats(ctx context.Context, opts ...FollowStatOption) (*FollowStatResponse, error) + func (f *FlatFeed) GetActivities(ctx context.Context, opts ...GetActivitiesOption) (*FlatFeedResponse, error) + func (f *FlatFeed) GetActivitiesWithRanking(ctx context.Context, ranking string, opts ...GetActivitiesOption) (*FlatFeedResponse, error) + func (f *FlatFeed) GetEnrichedActivities(ctx context.Context, opts ...GetActivitiesOption) (*EnrichedFlatFeedResponse, error) + func (f *FlatFeed) GetEnrichedActivitiesWithRanking(ctx context.Context, ranking string, opts ...GetActivitiesOption) (*EnrichedFlatFeedResponse, error) + func (f *FlatFeed) GetFollowers(ctx context.Context, opts ...FollowersOption) (*FollowersResponse, error) + func (f *FlatFeed) GetFollowing(ctx context.Context, opts ...FollowingOption) (*FollowingResponse, error) + func (f *FlatFeed) GetNextPageActivities(ctx context.Context, resp *FlatFeedResponse) (*FlatFeedResponse, error) + func (f *FlatFeed) GetNextPageEnrichedActivities(ctx context.Context, resp *EnrichedFlatFeedResponse) (*EnrichedFlatFeedResponse, error) + func (f *FlatFeed) ID() string + func (f *FlatFeed) RealtimeToken(readonly bool) string + func (f *FlatFeed) RemoveActivityByForeignID(ctx context.Context, foreignID string) (*RemoveActivityResponse, error) + func (f *FlatFeed) RemoveActivityByID(ctx context.Context, id string) (*RemoveActivityResponse, error) + func (f *FlatFeed) Slug() string + func (f *FlatFeed) Unfollow(ctx context.Context, target Feed, opts ...UnfollowOption) (*BaseResponse, error) + func (f *FlatFeed) UpdateToTargets(ctx context.Context, activity Activity, opts ...UpdateToTargetsOption) (*UpdateToTargetsResponse, error) + func (f *FlatFeed) UserID() string + type FlatFeedResponse struct + Results []Activity + type FollowFeedOption func(*followFeedOptions) + func WithFollowFeedActivityCopyLimit(activityCopyLimit int) FollowFeedOption + type FollowManyOption struct + func WithFollowManyActivityCopyLimit(activityCopyLimit int) FollowManyOption + type FollowRelationship struct + ActivityCopyLimit *int + Source string + Target string + func NewFollowRelationship(source, target Feed, opts ...FollowRelationshipOption) FollowRelationship + type FollowRelationshipOption func(r *FollowRelationship) + func WithFollowRelationshipActivityCopyLimit(activityCopyLimit int) FollowRelationshipOption + type FollowStatOption struct + func WithFollowerSlugs(slugs ...string) FollowStatOption + func WithFollowingSlugs(slugs ...string) FollowStatOption + type FollowStatResponse struct + type Follower struct + CreatedAt string + FeedID string + TargetID string + UpdatedAt string + type FollowersOption struct + func WithFollowersLimit(limit int) FollowersOption + func WithFollowersOffset(offset int) FollowersOption + type FollowersResponse struct + type FollowingOption struct + func WithFollowingFilter(ids ...string) FollowingOption + func WithFollowingLimit(limit int) FollowingOption + func WithFollowingOffset(offset int) FollowingOption + type FollowingResponse struct + type ForeignIDTimePair struct + ForeignID string + Timestamp Time + func NewForeignIDTimePair(foreignID string, timestamp Time) ForeignIDTimePair + type GetActivitiesOption struct + func WithActivitiesIDGT(id string) GetActivitiesOption + func WithActivitiesIDGTE(id string) GetActivitiesOption + func WithActivitiesIDLT(id string) GetActivitiesOption + func WithActivitiesIDLTE(id string) GetActivitiesOption + func WithActivitiesLimit(limit int) GetActivitiesOption + func WithActivitiesOffset(offset int) GetActivitiesOption + func WithCustomParam(name, value string) GetActivitiesOption + func WithEnrichFirstReactions() GetActivitiesOption + func WithEnrichOwnChildren() GetActivitiesOption + func WithEnrichOwnChildrenKindsFilter(kinds ...string) GetActivitiesOption + func WithEnrichOwnReactions() GetActivitiesOption + func WithEnrichReactionCounts() GetActivitiesOption + func WithEnrichReactionKindsFilter(kinds ...string) GetActivitiesOption + func WithEnrichReactionsLimit(limit int) GetActivitiesOption + func WithEnrichRecentReactions() GetActivitiesOption + func WithEnrichRecentReactionsLimit(limit int) GetActivitiesOption + func WithNotificationsMarkRead(all bool, activityIDs ...string) GetActivitiesOption + func WithNotificationsMarkSeen(all bool, activityIDs ...string) GetActivitiesOption + type GetActivitiesResponse struct + Results []Activity + type GetCollectionResponse struct + Objects []GetCollectionResponseObject + type GetCollectionResponseObject struct + Data map[string]interface{} + ForeignID string + type GetEnrichedActivitiesResponse struct + Results []EnrichedActivity + type ImpressionEventsData map[string]interface + func (d ImpressionEventsData) AddForeignIDs(foreignIDs ...string) ImpressionEventsData + func (d ImpressionEventsData) WithFeatures(features ...EventFeature) ImpressionEventsData + func (d ImpressionEventsData) WithFeedID(feedID string) ImpressionEventsData + func (d ImpressionEventsData) WithForeignIDs(foreignIDs ...string) ImpressionEventsData + func (d ImpressionEventsData) WithLocation(location string) ImpressionEventsData + func (d ImpressionEventsData) WithPosition(position int) ImpressionEventsData + func (d ImpressionEventsData) WithTrackedAt(trackedAt time.Time) ImpressionEventsData + func (d ImpressionEventsData) WithUserData(userData *UserData) ImpressionEventsData + type NotificationFeed struct + func (f *NotificationFeed) AddActivities(ctx context.Context, activities ...Activity) (*AddActivitiesResponse, error) + func (f *NotificationFeed) AddActivity(ctx context.Context, activity Activity) (*AddActivityResponse, error) + func (f *NotificationFeed) Follow(ctx context.Context, feed *FlatFeed, opts ...FollowFeedOption) (*BaseResponse, error) + func (f *NotificationFeed) GetActivities(ctx context.Context, opts ...GetActivitiesOption) (*NotificationFeedResponse, error) + func (f *NotificationFeed) GetEnrichedActivities(ctx context.Context, opts ...GetActivitiesOption) (*EnrichedNotificationFeedResponse, error) + func (f *NotificationFeed) GetFollowing(ctx context.Context, opts ...FollowingOption) (*FollowingResponse, error) + func (f *NotificationFeed) GetNextPageActivities(ctx context.Context, resp *NotificationFeedResponse) (*NotificationFeedResponse, error) + func (f *NotificationFeed) GetNextPageEnrichedActivities(ctx context.Context, resp *EnrichedNotificationFeedResponse) (*EnrichedNotificationFeedResponse, error) + func (f *NotificationFeed) ID() string + func (f *NotificationFeed) RealtimeToken(readonly bool) string + func (f *NotificationFeed) RemoveActivityByForeignID(ctx context.Context, foreignID string) (*RemoveActivityResponse, error) + func (f *NotificationFeed) RemoveActivityByID(ctx context.Context, id string) (*RemoveActivityResponse, error) + func (f *NotificationFeed) Slug() string + func (f *NotificationFeed) Unfollow(ctx context.Context, target Feed, opts ...UnfollowOption) (*BaseResponse, error) + func (f *NotificationFeed) UpdateToTargets(ctx context.Context, activity Activity, opts ...UpdateToTargetsOption) (*UpdateToTargetsResponse, error) + func (f *NotificationFeed) UserID() string + type NotificationFeedResponse struct + Results []NotificationFeedResult + type NotificationFeedResult struct + Activities []Activity + type PersonalizationClient struct + func (c *PersonalizationClient) Delete(ctx context.Context, resource string, params map[string]interface{}) (*PersonalizationResponse, error) + func (c *PersonalizationClient) Get(ctx context.Context, resource string, params map[string]interface{}) (*PersonalizationResponse, error) + func (c *PersonalizationClient) Post(ctx context.Context, resource string, params, data map[string]interface{}) (*PersonalizationResponse, error) + type PersonalizationResponse struct + AppID int + Duration Duration + Limit int + Next string + Offset int + Rate Rate + Results []map[string]interface{} + Version string + func (r *PersonalizationResponse) Extra() map[string]interface{} + func (r *PersonalizationResponse) UnmarshalJSON(data []byte) error + type Rate struct + Limit int + Remaining int + Reset Time + func NewRate(headers http.Header) *Rate + type Reaction struct + ChildrenCounters map[string]interface{} + ChildrenReactions map[string][]*Reaction + OwnChildren map[string][]*Reaction + type ReactionResponse struct + type ReactionsClient struct + func (c *ReactionsClient) Add(ctx context.Context, r AddReactionRequestObject) (*ReactionResponse, error) + func (c *ReactionsClient) AddChild(ctx context.Context, parentID string, r AddReactionRequestObject) (*ReactionResponse, error) + func (c *ReactionsClient) Delete(ctx context.Context, id string) (*ReactionResponse, error) + func (c *ReactionsClient) Filter(ctx context.Context, attr FilterReactionsAttribute, ...) (*FilterReactionResponse, error) + func (c *ReactionsClient) Get(ctx context.Context, id string) (*ReactionResponse, error) + func (c *ReactionsClient) GetNextPageFilteredReactions(ctx context.Context, resp *FilterReactionResponse) (*FilterReactionResponse, error) + func (c *ReactionsClient) Update(ctx context.Context, id string, data map[string]interface{}, ...) (*ReactionResponse, error) + type RemoveActivityResponse struct + Removed string + type Requester interface + Do func(*http.Request) (*http.Response, error) + type Time struct + func (t *Time) UnmarshalJSON(b []byte) error + func (t Time) MarshalJSON() ([]byte, error) + type UnfollowOption struct + func WithUnfollowKeepHistory(keepHistory bool) UnfollowOption + type UnfollowRelationship struct + KeepHistory bool + Source string + Target string + func NewUnfollowRelationship(source, target Feed, opts ...UnfollowRelationshipOption) UnfollowRelationship + type UnfollowRelationshipOption func(r *UnfollowRelationship) + func WithUnfollowRelationshipKeepHistory() UnfollowRelationshipOption + type UpdateActivitiesResponse struct + Activities []*Activity + type UpdateActivityRequest struct + ForeignID *string + ID *string + Set map[string]interface{} + Time *Time + Unset []string + func NewUpdateActivityRequestByForeignID(foreignID string, timestamp Time, set map[string]interface{}, unset []string) UpdateActivityRequest + func NewUpdateActivityRequestByID(id string, set map[string]interface{}, unset []string) UpdateActivityRequest + type UpdateActivityResponse struct + func (a *UpdateActivityResponse) UnmarshalJSON(buf []byte) error + type UpdateToTargetsOption func(*updateToTargetsRequest) + func WithToTargetsAdd(targets ...string) UpdateToTargetsOption + func WithToTargetsNew(targets ...string) UpdateToTargetsOption + func WithToTargetsRemove(targets ...string) UpdateToTargetsOption + type UpdateToTargetsResponse struct + Activity map[string]interface{} + Added []string + Removed []string + type User struct + Data map[string]interface{} + ID string + type UserData struct + func NewUserData() *UserData + func (d *UserData) Alias(alias string) *UserData + func (d *UserData) Int(id int) *UserData + func (d *UserData) String(id string) *UserData + type UserResponse struct + type UsersClient struct + func (c *UsersClient) Add(ctx context.Context, user User, getOrCreate bool) (*UserResponse, error) + func (c *UsersClient) CreateReference(id string) string + func (c *UsersClient) Delete(ctx context.Context, id string) (*BaseResponse, error) + func (c *UsersClient) Get(ctx context.Context, id string) (*UserResponse, error) + func (c *UsersClient) Update(ctx context.Context, id string, data map[string]interface{}) (*UserResponse, error) Other modules containing this package github.com/flockfw64/stream-go2