data_types

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkerTypeToCategory

func WorkerTypeToCategory(wt WorkerType) pubsub.WorkerCategory

WorkerTypeToCategory maps WorkerType to WorkerCategory

func WorkerTypeToDataSource added in v0.8.0

func WorkerTypeToDataSource(wt WorkerType) string

WorkerTypeToDataSource maps WorkerType to WorkerCategory

Types

type LoginEvent added in v0.8.9

type LoginEvent struct {
	PeerID      string `json:"peer_id"`
	UserID      string `json:"user_id"`
	Success     bool   `json:"success"`
	Error       string `json:"error,omitempty"`
	ServiceType string `json:"service_type"`
}

LoginEvent represents a user login event.

func NewLoginEvent added in v0.8.9

func NewLoginEvent(peerID, userID, serviceType string, success bool, error string) *LoginEvent

NewLoginEvent creates a new LoginEvent instance.

type WorkRequest

type WorkRequest struct {
	WorkType     WorkerType `json:"workType,omitempty"`
	RequestId    string     `json:"requestId,omitempty"`
	Data         []byte     `json:"data,omitempty"`
	WorkerPeerId string     `json:"workerPeerId,omitempty"`
}

type WorkResponse

type WorkResponse struct {
	WorkRequest  *WorkRequest `json:"workRequest,omitempty"`
	Data         interface{}  `json:"data,omitempty"`
	Error        string       `json:"error,omitempty"`
	WorkerPeerId string       `json:"workerPeerId,omitempty"`
	RecordCount  int          `json:"recordCount,omitempty"`
	LoginEvent   *LoginEvent  `json:"loginEvent,omitempty"`
}

type Worker

type Worker struct {
	IsLocal  bool
	IPAddr   string
	AddrInfo *peer.AddrInfo
	NodeData pubsub.NodeData
	Node     *node.OracleNode
}

func NewWorker added in v0.7.0

func NewWorker(isLocal bool, nd *pubsub.NodeData) *Worker

type WorkerType

type WorkerType string
const (
	Discord                 WorkerType = "discord"
	DiscordProfile          WorkerType = "discord-profile"
	DiscordChannelMessages  WorkerType = "discord-channel-messages"
	DiscordSentiment        WorkerType = "discord-sentiment"
	TelegramSentiment       WorkerType = "telegram-sentiment"
	TelegramChannelMessages WorkerType = "telegram-channel-messages"
	DiscordGuildChannels    WorkerType = "discord-guild-channels"
	DiscordUserGuilds       WorkerType = "discord-user-guilds"
	LLMChat                 WorkerType = "llm-chat"
	Twitter                 WorkerType = "twitter"
	TwitterFollowers        WorkerType = "twitter-followers"
	TwitterProfile          WorkerType = "twitter-profile"
	TwitterTweet            WorkerType = "twitter-tweet"
	Web                     WorkerType = "web"
	WebSentiment            WorkerType = "web-sentiment"
	Test                    WorkerType = "test"

	DataSourceTwitter  = "twitter"
	DataSourceDiscord  = "discord"
	DataSourceWeb      = "web"
	DataSourceTelegram = "telegram"
)

Jump to

Keyboard shortcuts

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