twid

package
v0.0.0-...-480f137 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTwicmdParser

func RegisterTwicmdParser(module TwicmdParser)

RegisterTwicmdParser registers a new Twicmd parser module globally.

func RegisterTwicmdService

func RegisterTwicmdService(service TwicmdService)

RegisterTwicmdService registers a new Twicmd service module globally.

func RegisterTwismsModule

func RegisterTwismsModule(module TwismsModule)

RegisterTwismsModule registers a new Twisms module globally.

func Start

func Start(ctx context.Context, cfg config.Root, logger *slog.Logger) error

Start starts the twid daemon. It runs until the context is canceled.

Types

type Starter

type Starter interface {
	Start(ctx context.Context) error
}

Starter describes any service that needs to be started. It is recommended to implement this over io.Closer.

type TwicmdParser

type TwicmdParser struct {
	Name string
	New  func(cfg json.RawMessage, logger *slog.Logger) (twicmd.CommandParser, error)
}

TwicmdParser describes a Twicmd parser module.

type TwicmdService

type TwicmdService struct {
	Name string
	New  func(cfg json.RawMessage, logger *slog.Logger) (twicmd.Service, error)
}

TwicmdService describes a Twicmd service module.

type TwismsModule

type TwismsModule struct {
	Name string
	Desc string
	New  func(cfg json.RawMessage, logger *slog.Logger) (twisms.MessageService, error)
}

TwismsModule describes a Twisms module.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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