types

package
v0.0.0-...-b40d7d9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalendarConfig

type CalendarConfig struct {
	Calendars []struct {
		URL string `yaml:"url"`
	} `yaml:"calendars"`
	TimezoneFormat string `yaml:"timezone-format"`
}

type DiscordInput

type DiscordInput struct {
	Message *discordgo.MessageCreate
}

Input data coming from discord

type DynamicOutreach

type DynamicOutreach struct {
	Function        string
	IntervalMinutes time.Duration
}

type FileOutput

type FileOutput struct {
	Filename string
	Content  []byte
}

Output data going to a local file

type Input

type Input struct {
	Message     string // The user's message in plaintext
	Permissions byte   // The permissions this input send has
	Data        any    // Any external program data from implementations

	Parameters objx.Map // Function parameters given in a function call by the model
}

Input content to a Horus library

func (*Input) GetBool

func (i *Input) GetBool(label string) bool

Get an boolean parameter from the model

func (*Input) GetInteger

func (i *Input) GetInteger(label string, def int) (int, bool)

Get an integer parameter from the model

func (*Input) GetString

func (i *Input) GetString(label string, def string) (string, bool)

Get a string parameter from the model

type Module

type Module interface {
	Handler(function string, input *Input) any // Handle function calls to the module
}

Module interface that the library uses to collect and use modules

type Output

type Output struct {
	Message string `json:"message"` // The library's message in plaintext
	Data    any    `json:"data"`    // Any external program data returned by the library
	Error   error  `json:"error"`   // Any error present in finding the output
}

Output response from a Horus library

type OutreachConfig

type OutreachConfig struct {
	Static []struct {
		Name   string `yaml:"name"`
		Key    string `yaml:"key"`
		Repeat string `yaml:"repeat"`
	} `yaml:"static"`

	Dynamic []struct {
		Name            string `yaml:"name"`
		Key             string `yaml:"key"`
		IntervalMinutes int    `yaml:"interval"`
	} `yaml:"dynamic"`
}

type OutreachMessage

type OutreachMessage interface {
	// Returns a function that returns the content of the message
	GetContent() string

	// Return a list of channels to send the message
	GetChannels() []chan string

	// Start starts the message repeating again
	Start() error

	// Stop stops the message from being sent and cancels it permenantly
	Stop() error

	// Delete stops and deletes the message forever
	Delete() error
}

OutreachMessage type is used to encode a message that will be sent to the user through a preferred communication method

type OutreachMethod

type OutreachMethod string
const (
	Discord  OutreachMethod = "discord"
	Telegram OutreachMethod = "telegram"
)

type OutreachServices

type OutreachServices struct {
	DB    *gorm.DB
	Cron  *cron.Cron
	Clock *time.Ticker
}

type StaticOutreach

type StaticOutreach struct {
	Function string
	Repeat   string
}

Jump to

Keyboard shortcuts

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