service

package
v0.0.0-...-95f8b43 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the main handler that binds Twipi and Discord.

func NewService

func NewService(s store.Store, logger *slog.Logger) *Service

NewService creates a new handler with the given twipi server and config.

func (*Service) AddAccount

func (s *Service) AddAccount(ctx context.Context, account store.Account) error

AddAccount adds an account to the handler. It blocks until the account is added. [Start] must be called before this function.

func (*Service) ApplyConfigurationValues

func (s *Service) ApplyConfigurationValues(context.Context, *twicmdcfgpb.ApplyRequest) (*twicmdcfgpb.ApplyResponse, error)

ApplyConfigurationValues implements twicmd.ConfigurableService.

func (*Service) ConfigurationValues

func (s *Service) ConfigurationValues(ctx context.Context, req *twicmdcfgpb.OptionsRequest) (*twicmdcfgpb.OptionsResponse, error)

ConfigurationValues implements twicmd.ConfigurableService.

func (*Service) Execute

Execute implements twicmd.Service.

func (*Service) Name

func (s *Service) Name() string

Name implements twicmd.Service.

func (*Service) SendMessage

func (s *Service) SendMessage(ctx context.Context, msg *twismsproto.Message) error

SendMessage sends a message through the Service's message channel. Messages sent here will go through the MessageSubscriber.

func (*Service) SendingNumber

func (s *Service) SendingNumber() (string, float64)

func (*Service) Service

func (s *Service) Service(ctx context.Context) (*twicmdproto.Service, error)

Service implements twicmd.Service.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start connects all the accounts. It blocks until ctx is canceled.

func (*Service) SubscribeMessages

func (s *Service) SubscribeMessages(ch chan<- *twismsproto.Message, filters *twismsproto.MessageFilters)

SubscribeMessages implements twisms.MessageSubscriber.

func (*Service) UnsubscribeMessages

func (s *Service) UnsubscribeMessages(ch chan<- *twismsproto.Message)

UnsubscribeMessages implements twisms.MessageSubscriber.

Jump to

Keyboard shortcuts

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