comms

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 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
}

func NewComms

func NewComms(c config.Config) *Comms

func (Comms) CommsSend

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

func (Comms) SendComms

func (c Comms) SendComms(commsPackage CommsPackage) error

type CommsCredentials added in v0.8.0

type CommsCredentials struct {
	Agent        agent.Agent `json:"agent_id"`
	CommsDetails interface{} `json:"comms_details"`
	System       string      `json:"system"`
}

type CommsPackage

type CommsPackage struct {
	Agent        agent.Agent
	Message      string
	Link         string
	TicketSystem string
}

type CommsStorage added in v0.8.0

type CommsStorage struct {
	Config  config.Config
	Context context.Context
}

func NewCommsStorage added in v0.8.0

func NewCommsStorage(c config.Config) *CommsStorage

func (CommsStorage) FetchCredentials added in v0.8.0

func (c CommsStorage) FetchCredentials(a agent.Agent) (CommsCredentials, error)

type CommsSystem

type CommsSystem interface {
	Connect() error

	ParseCredentials(interface{}) error

	Send(cp CommsPackage) error
}

type Communication

type Communication struct {
	Config config.Config
}

func NewCommunication

func NewCommunication(config config.Config) *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
}

func NewDiscord

func NewDiscord(c config.Config) *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
}

func NewSlack added in v0.5.0

func NewSlack(c config.Config) *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