messaging

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleSender

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

func (*ConsoleSender) GetName

func (s *ConsoleSender) GetName() string

func (*ConsoleSender) GetTimezone added in v0.0.3

func (s *ConsoleSender) GetTimezone() string

func (*ConsoleSender) Send

func (c *ConsoleSender) Send(events []*Event) error

type Event

type Event struct {
	Prefix          string
	Log             model.NukiSmartlockLogResponse
	ReservationName string
	Smartlock       model.SmartlockResponse
	Json            bool
}

func (Event) GetValues

func (e Event) GetValues(includeDate, emoji bool, tz string) map[string]string

func (Event) IsLogEvent added in v0.0.2

func (e Event) IsLogEvent() bool

func (Event) IsSmartlockEvent added in v0.0.2

func (e Event) IsSmartlockEvent() bool

func (Event) String

func (e Event) String(includeDate, emoji bool, tz string) string

type Sender

type Sender interface {
	Send(events []*Event) error
	GetName() string
	GetTimezone() string
}

type TelegramSender

type TelegramSender struct {
	Token  string `mapstructure:"token"`
	ChatID int64  `mapstructure:"chat_id"`
	// contains filtered or unexported fields
}

func (*TelegramSender) FormatLogEvent added in v0.0.4

func (t *TelegramSender) FormatLogEvent(e *Event) (string, error)

func (*TelegramSender) GetName

func (s *TelegramSender) GetName() string

func (*TelegramSender) GetTimezone added in v0.0.3

func (s *TelegramSender) GetTimezone() string

func (*TelegramSender) Send

func (t *TelegramSender) Send(events []*Event) error

Jump to

Keyboard shortcuts

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