func (a *AttackManager) Lookup(t string) (bool, error) {
	valid, num := validateNumber(t)
	if valid == false {
		return false, errors.New("Invalid attack target: " + t)
	}
	for _, attack := range a.repository {
		if attack.Target == num {
			return true, nil
		}
	}
	return false, nil
}
Lookup attempts to fetch one attack by target
package cmd
import (
	"errors"
	"math/rand"
	"time"
	"github.com/kevinburke/twilio-go"
	"github.com/sirupsen/logrus"
)
var client *twilio.Client
func (a *AttackManager) Initialize() {
	rand.Seed(time.Now().Unix())
	client = twilio.NewClient(Config.Twilio.SID, Config.Twilio.APIKey, nil)
	catfacts = loadJSONToSlice("data/catfacts.json", catfacts)
	responses = loadJSONToSlice("data/responses.json", responses)
}
func (a *AttackManager) Run() {
	log.WithFields(logrus.Fields{
		"Messaging Interval in Seconds": Config.Twilio.MsgIntervalSeconds,
	}).Debug(AppName + " now processing attacks")
	go func() {
		for {
			time.Sleep(time.Duration(Config.Twilio.MsgIntervalSeconds) * time.Second)
			for _, atk := range a.repository {
				msg, err := client.Messages.SendMessage(
					Config.Twilio.Number,
					atk.Target,
					getNextCatfact(atk.MsgCount),
					nil,
				)
				if err != nil {
					log.WithFields(logrus.Fields{
						"Error": err,
					}).Debug("Error sending Twilio SMS")
				}
				if msg != nil {
					log.WithFields(logrus.Fields{
						"Status": msg.Status,
					}).Debug("Twilio SMS sent!")
					atk.MsgCount++
				}
				log.WithFields(logrus.Fields{
					"ID":            atk.ID,
					"Target":        atk.Target,
					"Message Count": atk.MsgCount,
				}).Debug("Attack pulse")
			}
		}
	}()
}
func (a *AttackManager) getStatus() *StatusResponse {
	var targets []string
	for _, atk := range a.repository {
		targets = append(targets, atk.Target)
	}
	return &StatusResponse{
		AttackCount: len(a.repository),
		Targets:     targets,
	}
}
func (a *AttackManager) attackRunning(t string) (bool, *Attack) {
	for _, atk := range a.repository {
		if atk.Target == t {
			return true, atk
		}
	}
	return false, nil
}
func (a *AttackManager) List() []*Attack {
	return a.repository
}