entity

package
v0.0.0-...-e797cc8 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStreamIDs

func GetStreamIDs(streams []StreamInterface) []int64

Types

type Stream

type Stream struct {
	ID        int64
	TopicID   int64
	Track     string
	CreatedAt time.Time
}

Stream contains info required by twitter client to retrieve data from Twitter Streaming API and to store stream into the database

func (*Stream) GetCreatedAt

func (s *Stream) GetCreatedAt() time.Time

GetTrack returns the stream's track

func (*Stream) GetID

func (s *Stream) GetID() int64

GetID returns the Stream ID

func (*Stream) GetTopicID

func (s *Stream) GetTopicID() int64

GetID returns the Stream ID

func (*Stream) GetTrack

func (s *Stream) GetTrack() string

GetTrack returns the stream's track

type StreamInterface

type StreamInterface interface {
	GetID() int64
	GetTopicID() int64
	GetTrack() string
	GetCreatedAt() time.Time
}

StreamInterface describes entity Stream

func NewStreams

func NewStreams(tracks []string) []StreamInterface

func StreamsMapToSlice

func StreamsMapToSlice(streamsMap map[int64]StreamInterface) []StreamInterface

type Topic

type Topic struct {
	ID        int64
	UserID    int64
	Name      string
	CreatedAt time.Time
	IsActive  bool
}

Topic is a basic structure implementing TopicInterface

func (*Topic) GetCreatedAt

func (t *Topic) GetCreatedAt() time.Time

GetCreatedAt returns twit's full text

func (*Topic) GetID

func (t *Topic) GetID() int64

GetID returns the Topic ID from the tweetwatch platform

func (*Topic) GetIsActive

func (t *Topic) GetIsActive() bool

GetIsActive returns twit's full text

func (*Topic) GetName

func (t *Topic) GetName() string

GetName returns the topic's name

func (*Topic) GetUserID

func (t *Topic) GetUserID() int64

GetID returns the topic's owner User ID from the tweetwatch platform

type TopicInterface

type TopicInterface interface {
	GetID() int64
	GetUserID() int64
	GetName() string
	GetCreatedAt() time.Time
	GetIsActive() bool
}

TopicInterface defines methods implemented by the platform's entity topic.

type Tweet

type Tweet struct {
	ID              int64
	TwitterID       int64
	TwitterUserID   int64
	TwitterUsername string
	FullText        string
	CreatedAt       time.Time
}

Tweet is a basic structure implementing TweetInterface

func (*Tweet) GetCreatedAt

func (t *Tweet) GetCreatedAt() time.Time

GetCreatedAt returns the user id from twitter

func (*Tweet) GetFullText

func (t *Tweet) GetFullText() string

GetFullText returns twit's full text

func (*Tweet) GetID

func (t *Tweet) GetID() int64

GetID returns the Tweet ID from the tweetwatch platform

func (*Tweet) GetTwitterID

func (t *Tweet) GetTwitterID() int64

GetTwitterID returns the tweet id from twitter

func (*Tweet) GetTwitterUserID

func (t *Tweet) GetTwitterUserID() int64

GetTwitterUserID returns the user id from twitter

func (*Tweet) GetTwitterUsername

func (t *Tweet) GetTwitterUsername() string

GetTwitterUserID returns the user id from twitter

type TweetInterface

type TweetInterface interface {
	GetID() int64
	GetTwitterID() int64
	GetTwitterUserID() int64
	GetTwitterUsername() string
	GetFullText() string
	GetCreatedAt() time.Time
}

TweetInterface defines methods implemented by the platform's entity twit.

type TweetStreamsInterface

type TweetStreamsInterface interface {
	GetTweet() TweetInterface
	GetStreams() []StreamInterface
}

func NewTweetStreams

func NewTweetStreams(tweet TweetInterface, streams []StreamInterface) TweetStreamsInterface

Jump to

Keyboard shortcuts

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