Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrorSessionAlreadyOpen returned by a DiscordClient when already open ErrorSessionAlreadyOpen = fmt.Errorf("ingestor: session already open") //ErrorSessionAlreadyClosed returned by a DiscordClient when already closed ErrorSessionAlreadyClosed = fmt.Errorf("ingestor: session already closed") )
View Source
var ( //ErrorIngestorAlreadyOpen is returned by Ingestor when Ingestor.Open() has already been called ErrorIngestorAlreadyOpen = fmt.Errorf("ingestor already open") //ErrorIngestorAlreadyClosed is returned by Ingestor when Ingestor.Close() has already been called ErrorIngestorAlreadyClosed = fmt.Errorf("ingestor already closed") )
View Source
var (
ErrorKeyDoesNotExist = fmt.Errorf("KeyValueStore: key does not exist")
)
Functions ¶
This section is empty.
Types ¶
type DiscordClient ¶
type DiscordClient interface { //Open DiscordClient Open() error //Close DiscordClient Close() error //AddHandlerFunc that handles an Event AddHandlerFunc(interface{}) error }
DiscordClient is the interface called by Ingestor to make Discord API calls and set up the websocket
type DiscordClientMaker ¶
type DiscordClientMaker func(apikey string, intents primitives.GatewayIntent) DiscordClient
type DiscordConfig ¶
type DiscordConfig struct { DiscordAPIKey string DiscordClient DiscordClient }
type Ingestor ¶
type Ingestor struct { RedisConfig DiscordConfig // contains filtered or unexported fields }
func New ¶
func New(logger *log.Logger, discordClientMaker DiscordClientMaker, discordConfig DiscordConfig, redisConfig RedisConfig) *Ingestor
type KeyValueStore ¶
type KeyValueStore interface { Open() error Close() error Set(key string, reader io.Reader) error Get(key string) (io.Reader, error) Lock(key string) error Unlock(key string) error }
KeyValueStore is the store that Ingestor uses to store Rate limit/Other data
type RedisConfig ¶
type RedisConfig struct {
RedisEndPoints []string
}
Click to show internal directories.
Click to hide internal directories.