Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelCreator ¶
type ChannelCreator interface {
CreateChannel(ctx context.Context, guildID, name string) (string, error)
}
ChannelCreator can create Discord channels.
type ChannelEnsurer ¶
type ChannelEnsurer interface {
EnsureChannel(ctx context.Context, dirPath string) (string, error)
}
ChannelEnsurer resolves a directory path to a Discord channel ID, creating the channel if it does not yet exist.
func NewChannelService ¶
func NewChannelService(store db.Store, creator ChannelCreator, guildID string) ChannelEnsurer
NewChannelService creates a new ChannelEnsurer.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server exposes a lightweight HTTP API for task CRUD operations.
func NewServer ¶
func NewServer(sched scheduler.Scheduler, channels ChannelEnsurer, threads ThreadEnsurer, logger *slog.Logger) *Server
NewServer creates a new API server. The channels and threads parameters may be nil if channel/thread creation is not configured.
type ThreadCreator ¶ added in v0.1.11
type ThreadCreator interface {
CreateThread(ctx context.Context, channelID, name, mentionUserID string) (string, error)
}
ThreadCreator can create Discord threads.
type ThreadEnsurer ¶ added in v0.1.11
type ThreadEnsurer interface {
CreateThread(ctx context.Context, channelID, name, authorID string) (string, error)
}
ThreadEnsurer creates a thread in a channel and registers it in the DB.
func NewThreadService ¶ added in v0.1.11
func NewThreadService(store db.Store, creator ThreadCreator) ThreadEnsurer
NewThreadService creates a new ThreadEnsurer.
Click to show internal directories.
Click to hide internal directories.