box

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box interface {
	Notifyer
	Receiver
}

func New

func New(conf *NotifyConf) Box

type Message

type Message struct {
	Msg   string
	Title string
	Time  time.Time
}

func (*Message) String

func (m *Message) String() string

type Namer

type Namer interface {
	Name() string
}

type Notify

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

func (*Notify) Name

func (nf *Notify) Name() string

func (*Notify) Push

func (nf *Notify) Push(m *Message) error

func (*Notify) Receive

func (nf *Notify) Receive(fn func(*Message) bool) error

type NotifyConf

type NotifyConf struct {
	// email
	Email *emailConf `yaml:"email,omitempty"`

	// weixin
	FtangToken string `yaml:"tang,omitempty"`

	// gnotify
	Gnt *gtifyconf `yaml:"gnotify,omitempty"`
}

type Notifyer

type Notifyer interface {
	Namer
	Push(*Message) error
}

type Receiver

type Receiver interface {
	Namer
	Receive(func(*Message) bool) error
}

Jump to

Keyboard shortcuts

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