comms

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comms

type Comms struct {
	Config config.Config
	Logger zap.SugaredLogger
}

func NewComms

func NewComms(c config.Config, logger zap.SugaredLogger) *Comms

func (Comms) CommsSend

func (c Comms) CommsSend(system CommsSystem, creds database.CommsCredentials, commsPackage CommsPackage) error

func (Comms) SendComms

func (c Comms) SendComms(commsPackage CommsPackage) error

type CommsPackage

type CommsPackage struct {
	AgentID      string
	Message      string
	Link         string
	TicketSystem string
}

type CommsSystem

type CommsSystem interface {
	Connect() error

	ParseCredentials(interface{}) error

	Send(cp CommsPackage) error
}

type Communication

type Communication struct {
	Config config.Config
	Logger zap.SugaredLogger
}

func NewCommunication

func NewCommunication(config config.Config, logger zap.SugaredLogger) *Communication

func (Communication) AttachCommsHandler

func (c Communication) AttachCommsHandler(w http.ResponseWriter, r *http.Request)

func (Communication) CreateCommsHandler

func (c Communication) CreateCommsHandler(w http.ResponseWriter, r *http.Request)

func (Communication) DeleteCommsHandler

func (c Communication) DeleteCommsHandler(w http.ResponseWriter, r *http.Request)

func (Communication) DetachCommsHandler

func (c Communication) DetachCommsHandler(w http.ResponseWriter, r *http.Request)

func (Communication) ListCommsHandler

func (c Communication) ListCommsHandler(w http.ResponseWriter, r *http.Request)

type Credentials

type Credentials struct {
	AgentID string `json:"agent_id"`
}

type Discord

type Discord struct {
	BotAuth string

	Context     context.Context
	Credentials DiscordCredentials
	Config      config.Config
	Logger      zap.SugaredLogger
}

func NewDiscord

func NewDiscord(c config.Config, logger zap.SugaredLogger) *Discord

func (*Discord) Connect

func (d *Discord) Connect() error

func (*Discord) ParseCredentials

func (d *Discord) ParseCredentials(creds interface{}) error

func (*Discord) Send

func (d *Discord) Send(commsPackage CommsPackage) error

type DiscordCredentials

type DiscordCredentials struct {
	Channel string `json:"channel"`
	Credentials
}

type Slack added in v0.5.0

type Slack struct {
	Client *slack.Client

	Context     context.Context
	Credentials SlackCredentials
	Config      config.Config
	Logger      zap.SugaredLogger
}

func NewSlack added in v0.5.0

func NewSlack(c config.Config, logger zap.SugaredLogger) *Slack

func (*Slack) Connect added in v0.5.0

func (s *Slack) Connect() error

func (*Slack) ParseCredentials added in v0.5.0

func (s *Slack) ParseCredentials(creds interface{}) error

func (*Slack) Send added in v0.5.0

func (s *Slack) Send(commsPackage CommsPackage) error

type SlackCredentials added in v0.5.0

type SlackCredentials struct {
	Channel string `json:"channel"`
	Token   string `json:"token"`
	Credentials
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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