channel

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDiscord = iota
	TypeDingTalk
)
View Source
const (
	TypeStrDiscord  = "discord"
	TypeStrDingTalk = "dingtalk"
)
View Source
const DingTalkBotPrefix = DiscordBotPrefix
View Source
const DiscordBotPrefix = "<@%s>"
View Source
const UserIdentifierTemplate = "%s:%s" // <type>:<id>

Variables

Functions

This section is empty.

Types

type Channel

type Channel interface {
	// Start the channel
	Start(ctx context.Context, wg *sync.WaitGroup)
	// Stop the channel and clean up
	Stop(ctx context.Context)
}

func LoadChannels

func LoadChannels(ctx context.Context) ([]Channel, error)

type DingTalk

type DingTalk struct {
	ClientID     string
	ClientSecret string
	// contains filtered or unexported fields
}

func NewDingTalk

func NewDingTalk(clientID, clientSecret string) *DingTalk

func NewDingTalkWithCredential

func NewDingTalkWithCredential(credential string) (*DingTalk, error)

func (*DingTalk) Start

func (d *DingTalk) Start(ctx context.Context, wg *sync.WaitGroup)

func (*DingTalk) Stop

func (d *DingTalk) Stop(_ context.Context)

type DingTalkCredential

type DingTalkCredential struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type Discord

type Discord struct {
	Token string
	// contains filtered or unexported fields
}

func NewDiscord

func NewDiscord(token string) *Discord

func NewDiscordWithCredential

func NewDiscordWithCredential(credential string) (*Discord, error)

func (*Discord) Start

func (d *Discord) Start(ctx context.Context, wg *sync.WaitGroup)

func (*Discord) Stop

func (d *Discord) Stop(_ context.Context)

type DiscordCredential

type DiscordCredential struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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