Documentation ¶
Overview ¶
Package lists supports queries for lists.
Index ¶
- func Followers(listID string, opts *ListOpts) users.Query
- func Members(listID string, opts *ListOpts) users.Query
- func Tweets(listID string, opts *ListOpts) tweets.Query
- type Edit
- type ListOpts
- type Query
- func Create(name, description string, private bool) Query
- func FollowedBy(userID string, opts *ListOpts) Query
- func Lookup(id string, opts *ListOpts) Query
- func MemberOf(userID string, opts *ListOpts) Query
- func OwnedBy(userID string, opts *ListOpts) Query
- func PinnedBy(userID string, opts *ListOpts) Query
- type Reply
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Followers ¶
Followers constructs a query to list the followers of a list. Note that the query reply contains user data, not lists.
API: 2/lists/:id/followers
Types ¶
type Edit ¶
An Edit is a query to edit or delete a list or list membership.
func AddMember ¶
AddMember constructs a query to add a member to an existing list.
API: POST 2/lists/:id/members
func RemoveMember ¶
RemoveMember constructs a query to remove a member from a list.
API: DELETE 2/lists/:id/members/:userid
func Update ¶
func Update(id string, opts UpdateOpts) Edit
Update constructs a query to update an existing list.
API: PUT 2/lists/:id
type ListOpts ¶
type ListOpts struct { // A pagination token provided by the server. PageToken string // The maximum number of results to return; 0 means let the server choose. // The service will accept values up to 100. MaxResults int // Optional response fields and expansions. Optional []types.Fields }
ListOpts provide parameters for list queries. A nil *ListOpts provides empty values for all fields.
type Query ¶
A Query performs a query for list metadata.
func Create ¶
Create constructs a query to create a new list. A successful reply contains a single List value for the created list.
API: POST 2/lists
func FollowedBy ¶
FollowedBy constructs a query for the metadata of lists followed by the specified user ID.
API: 2/users/:id/followed_lists
func Lookup ¶
Lookup constructs a query for the metadata of a list by ID. A successful reply contains a single List value for the matching list.
API: 2/lists
func MemberOf ¶
MemberOf constructs a query for the metadata of lists the specified user ID belongs to.
API: 2/users/:id/list_memberships
func OwnedBy ¶
OwnedBy constructs a query for the metadata of lists owned by the specified user ID.
API: 2/users/:id/owned_lists
func PinnedBy ¶
PinnedBy constructs a query for the metadata of lists pinned by the specified user ID.
API: 2/users/:id/pinned_lists
func (Query) HasMorePages ¶
HasMorePages reports whether the query has more pages to fetch. This is true for a freshly-constructed query, and for an invoked query where the server has not reported a next-page token.
func (Query) ResetPageToken ¶
func (q Query) ResetPageToken()
ResetPageToken clears (resets) the query's current page token. Subsequently invoking the query will then fetch the first page of results.
type UpdateOpts ¶
type UpdateOpts struct { Name *string `json:"name,omitempty"` Desc *string `json:"description,omitempty"` Private *bool `json:"private,omitempty"` }
UpdateOpts provide parameters for list update queries. The fields that are non-nil are modified to the given values. Fields that are nil are not changed from their existing settings.
func (*UpdateOpts) SetDescription ¶
func (u *UpdateOpts) SetDescription(desc string) *UpdateOpts
SetDescription sets the option to update the description of the list.
func (*UpdateOpts) SetName ¶
func (u *UpdateOpts) SetName(name string) *UpdateOpts
SetName sets the option to update the name of the list.
func (*UpdateOpts) SetPrivate ¶
func (u *UpdateOpts) SetPrivate(private bool) *UpdateOpts
SetPrivate sets the option to mark a list private or non-private.