ingestor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 6 Imported by: 0

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

func (*Ingestor) Close

func (ingestor *Ingestor) Close() (err error)

func (*Ingestor) Open

func (ingestor *Ingestor) Open() (err error)

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
}

Jump to

Keyboard shortcuts

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