twitter

package
v0.0.0-...-2af310e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_twitter_proto protoreflect.FileDescriptor

Functions

func NewTwitterEndpoints

func NewTwitterEndpoints() []*api.Endpoint

func RegisterTwitterHandler

func RegisterTwitterHandler(s server.Server, hdlr TwitterHandler, opts ...server.HandlerOption) error

Types

type Profile

type Profile struct {

	// the user id
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// display name of the user
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// the username
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	// the user description
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	// the account creation date
	CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// the user's location
	Location string `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"`
	// the follower count
	Followers int64 `protobuf:"varint,7,opt,name=followers,proto3" json:"followers,omitempty"`
	// if the account is private
	Private bool `protobuf:"varint,8,opt,name=private,proto3" json:"private,omitempty"`
	// if the account is verified
	Verified bool `protobuf:"varint,9,opt,name=verified,proto3" json:"verified,omitempty"`
	// The user's profile picture
	ImageUrl string `protobuf:"bytes,10,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	// contains filtered or unexported fields
}

func (*Profile) Descriptor deprecated

func (*Profile) Descriptor() ([]byte, []int)

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetCreatedAt

func (x *Profile) GetCreatedAt() string

func (*Profile) GetDescription

func (x *Profile) GetDescription() string

func (*Profile) GetFollowers

func (x *Profile) GetFollowers() int64

func (*Profile) GetId

func (x *Profile) GetId() int64

func (*Profile) GetImageUrl

func (x *Profile) GetImageUrl() string

func (*Profile) GetLocation

func (x *Profile) GetLocation() string

func (*Profile) GetName

func (x *Profile) GetName() string

func (*Profile) GetPrivate

func (x *Profile) GetPrivate() bool

func (*Profile) GetUsername

func (x *Profile) GetUsername() string

func (*Profile) GetVerified

func (x *Profile) GetVerified() bool

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

func (x *Profile) ProtoReflect() protoreflect.Message

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

type SearchRequest

type SearchRequest struct {

	// the query to search for
	Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	// number of tweets to return. default: 20
	Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

Search for tweets with a simple query

func (*SearchRequest) Descriptor deprecated

func (*SearchRequest) Descriptor() ([]byte, []int)

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetLimit

func (x *SearchRequest) GetLimit() int32

func (*SearchRequest) GetQuery

func (x *SearchRequest) GetQuery() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

func (x *SearchRequest) ProtoReflect() protoreflect.Message

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) String

func (x *SearchRequest) String() string

type SearchResponse

type SearchResponse struct {

	// the related tweets for the search
	Tweets []*Tweet `protobuf:"bytes,2,rep,name=tweets,proto3" json:"tweets,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchResponse) Descriptor deprecated

func (*SearchResponse) Descriptor() ([]byte, []int)

Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.

func (*SearchResponse) GetTweets

func (x *SearchResponse) GetTweets() []*Tweet

func (*SearchResponse) ProtoMessage

func (*SearchResponse) ProtoMessage()

func (*SearchResponse) ProtoReflect

func (x *SearchResponse) ProtoReflect() protoreflect.Message

func (*SearchResponse) Reset

func (x *SearchResponse) Reset()

func (*SearchResponse) String

func (x *SearchResponse) String() string

type TimelineRequest

type TimelineRequest struct {

	// the username to request the timeline for
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// number of tweets to return. default: 20
	Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

Get the timeline for a given user

func (*TimelineRequest) Descriptor deprecated

func (*TimelineRequest) Descriptor() ([]byte, []int)

Deprecated: Use TimelineRequest.ProtoReflect.Descriptor instead.

func (*TimelineRequest) GetLimit

func (x *TimelineRequest) GetLimit() int32

func (*TimelineRequest) GetUsername

func (x *TimelineRequest) GetUsername() string

func (*TimelineRequest) ProtoMessage

func (*TimelineRequest) ProtoMessage()

func (*TimelineRequest) ProtoReflect

func (x *TimelineRequest) ProtoReflect() protoreflect.Message

func (*TimelineRequest) Reset

func (x *TimelineRequest) Reset()

func (*TimelineRequest) String

func (x *TimelineRequest) String() string

type TimelineResponse

type TimelineResponse struct {

	// The recent tweets for the user
	Tweets []*Tweet `protobuf:"bytes,1,rep,name=tweets,proto3" json:"tweets,omitempty"`
	// contains filtered or unexported fields
}

func (*TimelineResponse) Descriptor deprecated

func (*TimelineResponse) Descriptor() ([]byte, []int)

Deprecated: Use TimelineResponse.ProtoReflect.Descriptor instead.

func (*TimelineResponse) GetTweets

func (x *TimelineResponse) GetTweets() []*Tweet

func (*TimelineResponse) ProtoMessage

func (*TimelineResponse) ProtoMessage()

func (*TimelineResponse) ProtoReflect

func (x *TimelineResponse) ProtoReflect() protoreflect.Message

func (*TimelineResponse) Reset

func (x *TimelineResponse) Reset()

func (*TimelineResponse) String

func (x *TimelineResponse) String() string

type Trend

type Trend struct {

	// name of the trend
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// the twitter url
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// the volume of tweets in last 24 hours
	TweetVolume int64 `protobuf:"varint,3,opt,name=tweet_volume,json=tweetVolume,proto3" json:"tweet_volume,omitempty"`
	// contains filtered or unexported fields
}

func (*Trend) Descriptor deprecated

func (*Trend) Descriptor() ([]byte, []int)

Deprecated: Use Trend.ProtoReflect.Descriptor instead.

func (*Trend) GetName

func (x *Trend) GetName() string

func (*Trend) GetTweetVolume

func (x *Trend) GetTweetVolume() int64

func (*Trend) GetUrl

func (x *Trend) GetUrl() string

func (*Trend) ProtoMessage

func (*Trend) ProtoMessage()

func (*Trend) ProtoReflect

func (x *Trend) ProtoReflect() protoreflect.Message

func (*Trend) Reset

func (x *Trend) Reset()

func (*Trend) String

func (x *Trend) String() string

type TrendsRequest

type TrendsRequest struct {
	// contains filtered or unexported fields
}

Get the current global trending topics

func (*TrendsRequest) Descriptor deprecated

func (*TrendsRequest) Descriptor() ([]byte, []int)

Deprecated: Use TrendsRequest.ProtoReflect.Descriptor instead.

func (*TrendsRequest) ProtoMessage

func (*TrendsRequest) ProtoMessage()

func (*TrendsRequest) ProtoReflect

func (x *TrendsRequest) ProtoReflect() protoreflect.Message

func (*TrendsRequest) Reset

func (x *TrendsRequest) Reset()

func (*TrendsRequest) String

func (x *TrendsRequest) String() string

type TrendsResponse

type TrendsResponse struct {

	// a list of trending topics
	Trends []*Trend `protobuf:"bytes,1,rep,name=trends,proto3" json:"trends,omitempty"`
	// contains filtered or unexported fields
}

func (*TrendsResponse) Descriptor deprecated

func (*TrendsResponse) Descriptor() ([]byte, []int)

Deprecated: Use TrendsResponse.ProtoReflect.Descriptor instead.

func (*TrendsResponse) GetTrends

func (x *TrendsResponse) GetTrends() []*Trend

func (*TrendsResponse) ProtoMessage

func (*TrendsResponse) ProtoMessage()

func (*TrendsResponse) ProtoReflect

func (x *TrendsResponse) ProtoReflect() protoreflect.Message

func (*TrendsResponse) Reset

func (x *TrendsResponse) Reset()

func (*TrendsResponse) String

func (x *TrendsResponse) String() string

type Tweet

type Tweet struct {

	// id of the tweet
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// text of the tweet
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// username of the person who tweeted
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	// time of tweet
	CreatedAt string `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// number of times retweeted
	RetweetedCount int64 `protobuf:"varint,7,opt,name=retweeted_count,json=retweetedCount,proto3" json:"retweeted_count,omitempty"`
	// number of times favourited
	FavouritedCount int64 `protobuf:"varint,8,opt,name=favourited_count,json=favouritedCount,proto3" json:"favourited_count,omitempty"`
	// contains filtered or unexported fields
}

func (*Tweet) Descriptor deprecated

func (*Tweet) Descriptor() ([]byte, []int)

Deprecated: Use Tweet.ProtoReflect.Descriptor instead.

func (*Tweet) GetCreatedAt

func (x *Tweet) GetCreatedAt() string

func (*Tweet) GetFavouritedCount

func (x *Tweet) GetFavouritedCount() int64

func (*Tweet) GetId

func (x *Tweet) GetId() int64

func (*Tweet) GetRetweetedCount

func (x *Tweet) GetRetweetedCount() int64

func (*Tweet) GetText

func (x *Tweet) GetText() string

func (*Tweet) GetUsername

func (x *Tweet) GetUsername() string

func (*Tweet) ProtoMessage

func (*Tweet) ProtoMessage()

func (*Tweet) ProtoReflect

func (x *Tweet) ProtoReflect() protoreflect.Message

func (*Tweet) Reset

func (x *Tweet) Reset()

func (*Tweet) String

func (x *Tweet) String() string

type TwitterService

type TwitterService interface {
	Timeline(ctx context.Context, in *TimelineRequest, opts ...client.CallOption) (*TimelineResponse, error)
	Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error)
	User(ctx context.Context, in *UserRequest, opts ...client.CallOption) (*UserResponse, error)
	Trends(ctx context.Context, in *TrendsRequest, opts ...client.CallOption) (*TrendsResponse, error)
}

func NewTwitterService

func NewTwitterService(name string, c client.Client) TwitterService

type UserRequest

type UserRequest struct {

	// the username to lookup
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// contains filtered or unexported fields
}

Get a user's twitter profile

func (*UserRequest) Descriptor deprecated

func (*UserRequest) Descriptor() ([]byte, []int)

Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.

func (*UserRequest) GetUsername

func (x *UserRequest) GetUsername() string

func (*UserRequest) ProtoMessage

func (*UserRequest) ProtoMessage()

func (*UserRequest) ProtoReflect

func (x *UserRequest) ProtoReflect() protoreflect.Message

func (*UserRequest) Reset

func (x *UserRequest) Reset()

func (*UserRequest) String

func (x *UserRequest) String() string

type UserResponse

type UserResponse struct {

	// the current user status
	Status *Tweet `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// The requested user profile
	Profile *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"`
	// contains filtered or unexported fields
}

func (*UserResponse) Descriptor deprecated

func (*UserResponse) Descriptor() ([]byte, []int)

Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.

func (*UserResponse) GetProfile

func (x *UserResponse) GetProfile() *Profile

func (*UserResponse) GetStatus

func (x *UserResponse) GetStatus() *Tweet

func (*UserResponse) ProtoMessage

func (*UserResponse) ProtoMessage()

func (*UserResponse) ProtoReflect

func (x *UserResponse) ProtoReflect() protoreflect.Message

func (*UserResponse) Reset

func (x *UserResponse) Reset()

func (*UserResponse) String

func (x *UserResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL