slackbot

package
v0.0.0-...-10acafb Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name, bindAddr, botKey, token, tlsFile, caFile string, allowedOUs []string, log *logrus.Logger) (riker.Bot, error)

New is the constroctor for a bot

Types

type ErrorLoadingCert

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

ErrorLoadingCert Is returned when some failure to read/parse/load cert is encountered

func (ErrorLoadingCert) Error

func (e ErrorLoadingCert) Error() string

Error implements the error interface for this type

type SlackBot

type SlackBot struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

SlackBot is the slack adaptor for riker. It implments the riker.Bot interface for bridging redshirts to chat platforms

func (*SlackBot) ChatSend

func (b *SlackBot) ChatSend(msg, channel string)

func (*SlackBot) CommandStream

func (b *SlackBot) CommandStream(reg *botpb.Registration, stream botpb.Riker_CommandStreamServer) error

CommandStream is the call a client makes to setup a Push stream from riker -> client

func (*SlackBot) HealthZ

func (b *SlackBot) HealthZ() error

func (*SlackBot) NewRedShirt

func (b *SlackBot) NewRedShirt(ctx context.Context, cap *botpb.Capability) (*botpb.Registration, error)

NewRedShirt implements the riker protobuf server

func (*SlackBot) NextCommand

func (b *SlackBot) NextCommand(ctx context.Context, reg *botpb.Registration) (*botpb.Message, error)

NextCommand is the call a client makes to pull the next command from rikers command buffer

func (*SlackBot) Run

func (b *SlackBot) Run()

Run starts the bot

func (*SlackBot) Send

func (b *SlackBot) Send(ctx context.Context, msg *botpb.Message) (*botpb.SendResponse, error)

Send is the call a client makes to send a message back to riker

func (*SlackBot) SendStream

func (b *SlackBot) SendStream(stream botpb.Riker_SendStreamServer) error

SendStream is the call a client makes to send a stream message back to riker

Jump to

Keyboard shortcuts

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