conservator

package
v0.0.0-...-dbefbc8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package conservator herds service bots for external services.

Index

Constants

This section is empty.

Variables

View Source
var NOTIFICATION_TYPES = []string{"kill", "war", "locator", "application", "structure"}

Functions

This section is empty.

Types

type Channel

type Channel struct {
	IntegrationID int32          `db:"integrationID" json:"integrationID,omitempty"`
	ChannelID     string         `db:"channelID"  json:"channelID,omitempty"`
	ChannelName   string         `db:"channelName"  json:"channelName,omitempty"`
	Services      string         `db:"services" json:"services,omitempty"`
	OptionsJSON   string         `db:"options" json:"-"`
	Options       ChannelOptions `db:"-" json:"options,omitempty"`
}

type ChannelData

type ChannelData struct {
	ChannelID string
	Services  []string
}

type ChannelOptions

type ChannelOptions struct {
	Killmail struct {
		IgnoreHighSec    bool `json:"ignoreHighsec,omitempty"`
		IgnoreLowSec     bool `json:"ignoreLowsec,omitempty"`
		IgnoreNullSec    bool `json:"ignoreNullsec,omitempty"`
		IgnoreWorthless  bool `json:"ignoreWorthless,omitempty"`
		War              bool `json:"war,omitempty"`
		FactionWar       bool `json:"factionWar,omitempty"`
		SendAll          bool `json:"sendAll,omitempty"`
		SendAllAbyssalT4 bool `json:"sendAllAbyssalT4,omitempty"`
	} `json:"killmail,omitempty"`
}

type ChannelTypes

type ChannelTypes struct {
	War         bool `json:"war,omitempty"`         // war notifications
	Locator     bool `json:"locator,omitempty"`     // locator agent responses
	Kill        bool `json:"kill,omitempty"`        // killmails
	Structure   bool `json:"structure,omitempty"`   // structure notifications
	Application bool `json:"application,omitempty"` // applications to corp
}

func (*ChannelTypes) GetServices

func (c *ChannelTypes) GetServices() string

type Conservator

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

Conservator Handles our little bot.

func NewConservator

func NewConservator(redis *redis.Pool, db *sqlx.DB, addresses []string, discordToken string) *Conservator

NewConservator Service.

func (*Conservator) Close

func (s *Conservator) Close()

Close the conservator service

func (*Conservator) GetChannels

func (s *Conservator) GetChannels(integrationID *int32, reply *[][]string) error

func (*Conservator) GetRoles

func (s *Conservator) GetRoles(integrationID *int32, reply *[][]string) error

func (*Conservator) JoinUser

func (s *Conservator) JoinUser(j *JoinUser, reply *bool) error

func (*Conservator) Run

func (s *Conservator) Run()

Run the conservator service

func (*Conservator) VerifyDiscord

func (s *Conservator) VerifyDiscord(args *string, reply *bool) error

func (*Conservator) VerifyDiscordChannel

func (s *Conservator) VerifyDiscordChannel(args []string, reply *bool) error

type EntityName

type EntityName struct {
	Name       string `db:"name" json:"name"`
	EntityType string `db:"type" json:"type"`
}

type JoinUser

type JoinUser struct {
	AccessToken   string
	IntegrationID int32
	UserID        string
	CharacterName string
	CharacterID   int32
}

type Service

type Service struct {
	Server         botservice.Integration `json:"-,omitempty"`
	IntegrationID  int32                  `db:"integrationID" json:"integrationID,omitempty"`
	FactionID      int32                  `db:"factionID" json:"factionID,omitempty"`
	Name           string                 `db:"name" json:"name,omitempty"`
	EntityID       int32                  `db:"entityID" json:"entityID,omitempty"`
	EntityName     string                 `db:"entityName" json:"entityName,omitempty"`
	EntityType     string                 `db:"entityType" json:"entityType,omitempty"`
	Address        string                 `db:"address" json:"address,omitempty" `
	Authentication string                 `db:"authentication,omitempty"`
	Type           string                 `db:"type" json:"type,omitempty"`
	Services       string                 `db:"services" json:"services,omitempty"`
	OptionsJSON    string                 `db:"options" json:"-"`
	Options        ServiceOptions         `db:"-" json:"options,omitempty"`
}

type ServiceOptions

type ServiceOptions struct {
	Auth struct {
		Members       string `json:"members,omitempty"`
		PlusFive      string `json:"plusFive,omitempty"`
		PlusTen       string `json:"plusTen,omitempty"`
		Militia       string `json:"militia,omitempty"`
		AlliedMilitia string `json:"alliedMilitia,omitempty"`
	} `json:"auth,omitempty"`
}

type ServiceTypes

type ServiceTypes struct {
	Auth bool `json:"auth,omitempty"` // Authentication
}

func (*ServiceTypes) GetServices

func (c *ServiceTypes) GetServices() string

type Share

type Share struct {
	IntegrationID      int32  `db:"integrationID" json:"integrationID,omitempty"`
	CharacterID        int32  `db:"characterID" json:"characterID,omitempty"`
	TokenCharacterID   int32  `db:"tokenCharacterID" json:"tokenCharacterID,omitempty"`
	TokenCharacterName string `db:"tokenCharacterName" json:"tokenCharacterName,omitempty"`
	EntityID           int32  `db:"entityID" json:"entityID,omitempty"`
	EntityName         string `db:"entityName" json:"entityName,omitempty"`
	EntityType         string `db:"entityType" json:"entityType,omitempty"`
	Type               string `db:"type" json:"type,omitempty"`
	Types              string `db:"types" json:"types,omitempty"`
	Packed             string `db:"packed" json:"packed,omitempty"`
	Ignored            int32  `db:"ignored" json:"ignored,omitempty"`
}

Jump to

Keyboard shortcuts

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