database

package
v0.0.0-...-1b8f325 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Has

func Has(b, flag Bits) bool

func SetDDBLogger

func SetDDBLogger(logger *logrus.Logger) func(*DDBDriver)

func SetDDBProfile

func SetDDBProfile(profile string) func(*DDBDriver)

func SetDDBRegion

func SetDDBRegion(region string) func(*DDBDriver)

func SetDDBTablePrefix

func SetDDBTablePrefix(tablePrefix string) func(*DDBDriver)

Types

type Bits

type Bits uint8
const (
	F_favorites Bits = 1 << iota
	F_followers
	F_friends
	F_timeline
	F_user
)

func Clear

func Clear(b, flag Bits) Bits

func Set

func Set(b, flag Bits) Bits

func Toggle

func Toggle(b, flag Bits) Bits

type CursoredTweetConfigQuery

type CursoredTweetConfigQuery struct {
	UserID         int64
	PreviousCursor int64
	NextCursor     int64
}

type DDBDriver

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

func NewDDB

func NewDDB(opts ...func(*DDBDriver)) *DDBDriver

func (*DDBDriver) DeleteMedia

func (config *DDBDriver) DeleteMedia(mediaItem *MediaItem) error

func (*DDBDriver) DeleteRunnerUser

func (config *DDBDriver) DeleteRunnerUser(params *RunnerItem) error

func (*DDBDriver) ExportList

func (config *DDBDriver) ExportList(tableArn string) (*dynamodb.ListExportsOutput, error)

func (*DDBDriver) ExportStatus

func (config *DDBDriver) ExportStatus(exportArn string) (*dynamodb.DescribeExportOutput, error)

func (*DDBDriver) ExportTable

func (*DDBDriver) GetDriverName

func (config *DDBDriver) GetDriverName() string

func (*DDBDriver) GetFavoritesByTweetId

func (config *DDBDriver) GetFavoritesByTweetId(tweetID int64) ([]*UserToTweetLink, error)

func (*DDBDriver) GetFavoritesByUserId

func (config *DDBDriver) GetFavoritesByUserId(userID int64) ([]*UserToTweetLink, error)

func (*DDBDriver) GetFavoritesConfig

func (config *DDBDriver) GetFavoritesConfig(userID int64) (*FavoritesItem, error)

func (*DDBDriver) GetFollowersByFollowId

func (config *DDBDriver) GetFollowersByFollowId(followID int64) ([]*UserToFollowerLink, error)

func (*DDBDriver) GetFollowersByUserId

func (config *DDBDriver) GetFollowersByUserId(userID int64) ([]*UserToFollowerLink, error)

func (*DDBDriver) GetFollowersConfig

func (config *DDBDriver) GetFollowersConfig(userID int64) (*FollowersItem, error)

func (*DDBDriver) GetFriendsByFriendId

func (config *DDBDriver) GetFriendsByFriendId(friendID int64) ([]*UserToFriendLink, error)

func (*DDBDriver) GetFriendsByUserId

func (config *DDBDriver) GetFriendsByUserId(userID int64) ([]*UserToFriendLink, error)

func (*DDBDriver) GetFriendsConfig

func (config *DDBDriver) GetFriendsConfig(userID int64) (*FriendsItem, error)

func (*DDBDriver) GetRunnerUsers

func (config *DDBDriver) GetRunnerUsers(runnerUsers *RunnerItem) ([]*RunnerItem, error)

func (*DDBDriver) GetTimelineConfig

func (config *DDBDriver) GetTimelineConfig(userID int64) (*TweetsItem, error)

func (*DDBDriver) PutFavorites

func (config *DDBDriver) PutFavorites(links []*UserToTweetLink) error

func (*DDBDriver) PutFavoritesConfig

func (config *DDBDriver) PutFavoritesConfig(query *TweetConfigQuery) error

func (*DDBDriver) PutFollowers

func (config *DDBDriver) PutFollowers(links []*UserToFollowerLink) error

func (*DDBDriver) PutFollowersConfig

func (config *DDBDriver) PutFollowersConfig(query *CursoredTweetConfigQuery) error

func (*DDBDriver) PutFriends

func (config *DDBDriver) PutFriends(links []*UserToFriendLink) error

func (*DDBDriver) PutFriendsConfig

func (config *DDBDriver) PutFriendsConfig(query *CursoredTweetConfigQuery) error

func (*DDBDriver) PutMedia

func (config *DDBDriver) PutMedia(mediaItem *MediaItem) error

func (*DDBDriver) PutRunnerFlags

func (config *DDBDriver) PutRunnerFlags(params *RunnerItem) error

func (*DDBDriver) PutTimelineConfig

func (config *DDBDriver) PutTimelineConfig(query *TweetConfigQuery) error

type DDBOption

type DDBOption func(config *DDBDriver)

type FavoritesItem

type FavoritesItem struct {
	Domain              string    `json:"Domain" yaml:"Domain"`
	UserID              int64     `json:"UserID" yaml:"UserID"`
	MaxID               int64     `json:"MaxID" yaml:"MaxID"`
	SinceID             int64     `json:"SinceID" yaml:"SinceID"`
	LastUpdate          int64     `json:"LastUpdate" yaml:"LastUpdate"`
	LastUpdateTimestamp time.Time `json:"LastUpdateTimestamp" yaml:"LastUpdateTimestamp"`
}

type FollowersItem

type FollowersItem struct {
	Domain              string    `json:"Domain" yaml:"Domain"`
	UserID              int64     `json:"UserID" yaml:"UserID"`
	NextCursor          int64     `json:"NextCursor" yaml:"NextCursor"`
	PreviousCursor      int64     `json:"PreviousCursor" yaml:"PreviousCursor"`
	LastUpdate          int64     `json:"LastUpdate" yaml:"LastUpdate"`
	LastUpdateTimestamp time.Time `json:"LastUpdateTimestamp" yaml:"LastUpdateTimestamp"`
}

type FriendsItem

type FriendsItem struct {
	Domain              string    `json:"Domain" yaml:"Domain"`
	UserID              int64     `json:"UserID" yaml:"UserID"`
	NextCursor          int64     `json:"NextCursor" yaml:"NextCursor"`
	PreviousCursor      int64     `json:"PreviousCursor" yaml:"PreviousCursor"`
	LastUpdate          int64     `json:"LastUpdate" yaml:"LastUpdate"`
	LastUpdateTimestamp time.Time `json:"LastUpdateTimestamp" yaml:"LastUpdateTimestamp"`
}

type MediaItem

type MediaItem struct {
	Bucket          string                             `json:"Bucket"`
	S3Key           string                             `json:"S3Key"`
	UserID          int64                              `json:"UserID"`
	TweetID         int64                              `json:"TweetID"`
	Faces           []rekognitionTypes.FaceDetail      `json:"Faces"`
	Labels          []rekognitionTypes.Label           `json:"Labels"`
	Moderation      []rekognitionTypes.ModerationLabel `json:"Moderation"`
	Text            []rekognitionTypes.TextDetection   `json:"Text"`
	FacesCount      int                                `json:"FacesCount"`
	LabelsCount     int                                `json:"LabelsCount"`
	ModerationCount int                                `json:"ModerationCount"`
	TextCount       int                                `json:"TextCount"`
}

type RunnerItem

type RunnerItem struct {
	RunnerName string `json:"RunnerName"`
	UserID     int64  `json:"UserID"`
	Flags      Bits   `json:"Flags"`
	LastUpdate int64  `json:"LastUpdate"`
}

type TableExportRequest

type TableExportRequest struct {
	ClientToken string
	//DYNAMODB_JSON or ION
	ExportFormat string
	ExportTime   time.Time

	S3Bucket string
	S3Prefix string
	TableArn string
	// contains filtered or unexported fields
}

type TweetConfigQuery

type TweetConfigQuery struct {
	UserID     int64
	SinceID    int64
	MaxID      int64
	LastUpdate int64
}

type TweetsItem

type TweetsItem struct {
	Domain              string    `json:"Domain" yaml:"Domain"`
	UserID              int64     `json:"UserID" yaml:"UserID"`
	MaxID               int64     `json:"MaxID" yaml:"MaxID"`
	SinceID             int64     `json:"SinceID" yaml:"SinceID"`
	LastUpdate          int64     `json:"LastUpdate" yaml:"LastUpdate"`
	LastUpdateTimestamp time.Time `json:"LastUpdateTimestamp" yaml:"LastUpdateTimestamp"`
}
type UserToFollowerLink struct {
	UserID     int64 `json:"UserID"`
	FollowerID int64 `json:"FollowerID"`
}
type UserToFriendLink struct {
	UserID   int64 `json:"UserID"`
	FriendID int64 `json:"FriendID"`
}
type UserToTweetLink struct {
	UserID  int64 `json:"UserID"`
	TweetID int64 `json:"TweetID"`
}

Jump to

Keyboard shortcuts

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