mixin

package module
v0.0.0-...-41b8a60 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

Mixin Notification

Feature

  • Send notification to Mixin Messenger

Config

Get your Mixin Bot Config: https://developers.mixin.one/dashboard

  • Client ID
  • Session ID
  • Server Public Key
  • Session Private Key

Preview

Document

Mixin Bot API

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Notification

type Notification struct {
	MixinBot     *mixin.Client
	MixinBotUser *mixin.User

	Config          *NotificationConfig
	UserConfigCache *UserConfigCache
	// contains filtered or unexported fields
}

func (*Notification) ConfigFields

func (n *Notification) ConfigFields() []plugin.ConfigField

func (*Notification) ConfigReceiver

func (n *Notification) ConfigReceiver(config []byte) error

func (*Notification) GetNewQuestionSubscribers

func (n *Notification) GetNewQuestionSubscribers() (userIDs []string)

func (*Notification) Info

func (n *Notification) Info() plugin.Info

func (*Notification) Notify

func (n *Notification) Notify(msg plugin.NotificationMessage)

func (*Notification) UserConfigFields

func (n *Notification) UserConfigFields() []plugin.ConfigField

func (*Notification) UserConfigReceiver

func (n *Notification) UserConfigReceiver(userID string, config []byte) error

type NotificationConfig

type NotificationConfig struct {
	Notification      bool   `json:"notification"`
	ClientID          string `json:"client_id" mapstructure:"client_id" yaml:"client_id"`
	SessionID         string `json:"session_id" mapstructure:"session_id" yaml:"session_id"`
	ServerPublicKey   string `json:"server_public_key" mapstructure:"server_public_key" yaml:"server_public_key"`
	SessionPrivateKey string `json:"session_private_key" mapstructure:"session_private_key" yaml:"session_private_key"`
}

type UserConfig

type UserConfig struct {
	MixinID                      string `json:"mixin_id"`
	InboxNotifications           bool   `json:"inbox_notifications"`
	AllNewQuestions              bool   `json:"all_new_questions"`
	NewQuestionsForFollowingTags bool   `json:"new_questions_for_following_tags"`
}

type UserConfigCache

type UserConfigCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUserConfigCache

func NewUserConfigCache() *UserConfigCache

func (*UserConfigCache) SetUserConfig

func (ucc *UserConfigCache) SetUserConfig(userID string, config *UserConfig)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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