discord

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name     = "discord"
	Version  = "v0.0.0"
	CommitID = ""
)
View Source
var DefaultReceiverConfig = ReceiverConfig{
	BotToken:        "",
	UseShardMonitor: pointer.Bool(false),
}

Functions

func NewPlugin

func NewPlugin() (*pkgplugin.Plugin, error)

func NewPluginVersion

func NewPluginVersion(name string, version string, commitID string) (*pkgplugin.Plugin, error)

func NewReceiver

func NewReceiver(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault, tableSyncer syncer.DeltaSyncer) (receiver.Receiver, error)

func NewSender

func NewSender(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault, tableSyncer syncer.DeltaSyncer) (sender.Sender, error)

Types

type Receiver

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

func (*Receiver) Config

func (r *Receiver) Config() interface{}

func (*Receiver) EventErrorCount added in v1.1.2

func (r *Receiver) EventErrorCount() int

func (*Receiver) EventErrorVelocity added in v1.1.2

func (r *Receiver) EventErrorVelocity() int

func (*Receiver) EventSuccessCount added in v1.1.2

func (r *Receiver) EventSuccessCount() int

func (*Receiver) EventSuccessVelocity added in v1.1.2

func (r *Receiver) EventSuccessVelocity() int

func (*Receiver) EventTs added in v1.1.2

func (r *Receiver) EventTs() int64

func (*Receiver) Hash added in v1.1.2

func (r *Receiver) Hash() string

func (*Receiver) LogSuccess added in v1.1.2

func (r *Receiver) LogSuccess()

func (*Receiver) Name

func (r *Receiver) Name() string

func (*Receiver) Plugin

func (r *Receiver) Plugin() string

func (*Receiver) Receive

func (r *Receiver) Receive(next receiver.NextFn) error

func (*Receiver) StopReceiving

func (r *Receiver) StopReceiving(ctx context.Context) error

func (*Receiver) Tenant

func (r *Receiver) Tenant() tenant.Id

func (*Receiver) Trigger

func (r *Receiver) Trigger(e event.Event)

type ReceiverConfig

type ReceiverConfig struct {
	BotToken        string `json:"botToken"`
	UseShardMonitor *bool  `json:"useShardMonitor,omitempty"`
}

func (*ReceiverConfig) Validate

func (rc *ReceiverConfig) Validate() error

Validate returns an error upon validation failure

func (*ReceiverConfig) WithDefaults

func (rc *ReceiverConfig) WithDefaults() ReceiverConfig

WithDefaults returns a new config object that has all of the unset (nil) values filled in.

type Sender

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

func (*Sender) Config

func (r *Sender) Config() interface{}

func (*Sender) EventErrorCount added in v1.1.2

func (s *Sender) EventErrorCount() int

func (*Sender) EventErrorVelocity added in v1.1.2

func (s *Sender) EventErrorVelocity() int

func (*Sender) EventSuccessCount added in v1.1.2

func (s *Sender) EventSuccessCount() int

func (*Sender) EventSuccessVelocity added in v1.1.2

func (s *Sender) EventSuccessVelocity() int

func (*Sender) EventTs added in v1.1.2

func (s *Sender) EventTs() int64

func (*Sender) Hash added in v1.1.2

func (s *Sender) Hash() string

func (*Sender) Name

func (s *Sender) Name() string

func (*Sender) Plugin

func (s *Sender) Plugin() string

func (*Sender) Send

func (s *Sender) Send(event event.Event)

func (*Sender) StopSending

func (s *Sender) StopSending(ctx context.Context)

func (*Sender) Tenant

func (s *Sender) Tenant() tenant.Id

func (*Sender) Unwrap

func (s *Sender) Unwrap() sender.Sender

type SenderConfig

type SenderConfig struct {
	BotToken  string `json:"botToken"`
	ChannelId string `json:"channelId"`
}

func (*SenderConfig) Validate

func (sc *SenderConfig) Validate() error

Validate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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