scenario

package
v0.0.0-...-33dc450 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateExploitRounds

func GenerateExploitRounds(allTime, roundPeriod string, exploitInfo Exploit) []int

Types

type Exploit

type Exploit struct {
	StartAt string `yaml:"startAt" bson:"start_at,omitempty"`
	Period  string `yaml:"period" bson:"period,omitempty"`
	Cost    int    `yaml:"cost" bson:"cost,omitempty"`
	Rounds  []int  `bson:"rounds,omitempty"`
}

type News

type News struct {
	Round int    `yaml:"round" bson:"round,omitempty"`
	Text  string `yaml:"text" bson:"text,omitempty"`
	Mode  string `yaml:"mode" bson:"mode,omitempty"`
}

type Scenario

type Scenario struct {
	ID            string             `bson:"id,omitempty"`
	Time          string             `yaml:"time" bson:"time,omitempty"`
	Period        string             `yaml:"period" bson:"period,omitempty"`
	GlobalActions []string           `yaml:"global_actions" bson:"global_actions,omitempty"`
	Actions       []string           `yaml:"actions" bson:"actions,omitempty"`
	Services      map[string]Service `yaml:"services" bson:"services,omitempty"`
	NewsChatID    int                `yaml:"news_chat_id" bson:"news_chat_id,omitempty"`
	News          []News             `yaml:"news" bson:"news,omitempty"`
}

func LoadScenario

func LoadScenario(filename string) *Scenario

func (*Scenario) SaveToDB

func (s *Scenario) SaveToDB()

type Service

type Service struct {
	Name        string             `yaml:"name" bson:"name,omitempty"`
	Description string             `yaml:"description" bson:"description,omitempty"`
	Reputation  int                `yaml:"reputation" bson:"reputation,omitempty"`
	Domain      string             `yaml:"domain" bson:"domain,omitempty"`
	Script      string             `yaml:"script" bson:"script,omitempty"`
	Checkers    []string           `yaml:"checkers" bson:"checkers,omitempty"`
	Exploits    map[string]Exploit `yaml:"exploits" bson:"exploits,omitempty"`
}

Jump to

Keyboard shortcuts

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