Documentation ¶
Overview ¶
Package action defines a set of common argument structures. This is used so that we can more easily share functionality between the multiple different interfaces.
Index ¶
- type Author
- type BanASNRequest
- type BanNetRequest
- type BanRequest
- type BaseOrigin
- type CSayRequest
- type Duration
- type Executor
- type FilterAddRequest
- type FilterCheckRequest
- type FilterDelRequest
- type FindCIDRRequest
- type FindRequest
- type GetASNRecordRequest
- type GetBanNetRequest
- type GetBanRequest
- type GetChatHistoryRequest
- type GetHistoryChatRequest
- type GetHistoryIPRequest
- type GetLocationRecordRequest
- type GetOrCreatePersonByIDRequest
- type GetOrCreateProfileBySteamIDRequest
- type GetPersonByIDRequest
- type GetProxyRecordRequest
- type KickRequest
- type MuteRequest
- type PSayRequest
- type ProfileRequest
- type SayRequest
- type ServerByNameRequest
- type SetSteamIDRequest
- type Target
- type UnbanASNRequest
- type UnbanRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BanASNRequest ¶ added in v0.1.8
type BanNetRequest ¶
type BanRequest ¶
type BaseOrigin ¶ added in v0.1.8
BaseOrigin defines the base struct for all actions. It just marks where the event originated.
type CSayRequest ¶
type CSayRequest SayRequest
type Duration ¶
type Duration string
Duration defines the length of time the action should be valid for A duration of 0 will be interpreted as permanent and set to 10 years in the future
type Executor ¶ added in v0.1.8
type Executor interface { Find(playerStr string, ip string, pi *model.PlayerInfo) error FindPlayerByCIDR(ipNet *net.IPNet, pi *model.PlayerInfo) error PersonBySID(sid steamid.SID64, ipAddr string, p *model.Person) error GetOrCreateProfileBySteamID(ctx context.Context, sid steamid.SID64, ipAddr string, p *model.Person) error Ban(args BanRequest, b *model.Ban) error BanNetwork(args BanNetRequest, net *model.BanNet) error BanASN(args BanASNRequest, net *model.BanASN) error Unban(args UnbanRequest) (bool, error) UnbanASN(ctx context.Context, args UnbanASNRequest) (bool, error) Kick(args KickRequest, pi *model.PlayerInfo) error Say(args SayRequest) error CSay(args CSayRequest) error PSay(args PSayRequest) error ResolveSID(sidStr string) (steamid.SID64, error) SetSteam(args SetSteamIDRequest) (bool, error) ServerState() model.ServerStateCollection ContainsFilteredWord(body string) (bool, model.Filter) FilterDel(ctx context.Context, args FilterDelRequest) (bool, error) FilterAdd(args FilterAddRequest) (model.Filter, error) FilterCheck(args FilterCheckRequest) []model.Filter }
Executor implements the common interface for the core application functionality. Its currently implemented like this so that we can avoid cyclic dependency issues. This is a strong candidate for a better refactor. The secondary purpose is to allow a common interface for executing action logic in a common manner from multiple different interfaces, such as web and discord.
type FilterAddRequest ¶
type FilterAddRequest struct { BaseOrigin Author Filter string }
func NewFilterAdd ¶
func NewFilterAdd(o model.Origin, filter string) FilterAddRequest
type FilterCheckRequest ¶
type FilterCheckRequest struct { BaseOrigin Author Message string }
func NewFilterCheck ¶
func NewFilterCheck(o model.Origin, message string) FilterCheckRequest
type FilterDelRequest ¶
type FilterDelRequest struct { BaseOrigin Author FilterID int }
func NewFilterDel ¶
func NewFilterDel(o model.Origin, filterID int) FilterDelRequest
type FindCIDRRequest ¶
type FindCIDRRequest struct { BaseOrigin CIDR *net.IPNet }
func NewFindByCIDR ¶
func NewFindByCIDR(o model.Origin, cidr *net.IPNet) FindCIDRRequest
type FindRequest ¶
type FindRequest struct { BaseOrigin Query string }
type GetASNRecordRequest ¶
type GetASNRecordRequest struct { BaseOrigin IPAddr string }
func NewGetASNRecord ¶
func NewGetASNRecord(o model.Origin, ipAddr string) GetASNRecordRequest
type GetBanNetRequest ¶
type GetBanNetRequest GetBanRequest
func NewGetBanNet ¶
func NewGetBanNet(o model.Origin, target string) GetBanNetRequest
type GetBanRequest ¶
type GetBanRequest struct { BaseOrigin Target }
type GetChatHistoryRequest ¶
type GetChatHistoryRequest struct { BaseOrigin Target Page int }
func NewGetChatHistory ¶
func NewGetChatHistory(o model.Origin, target string, page int) GetChatHistoryRequest
type GetHistoryChatRequest ¶
type GetHistoryChatRequest GetHistoryIPRequest
func NewGetHistoryChat ¶
func NewGetHistoryChat(o model.Origin, target string) GetHistoryChatRequest
type GetHistoryIPRequest ¶
type GetHistoryIPRequest struct { BaseOrigin Author Target }
func NewGetHistoryIP ¶
func NewGetHistoryIP(o model.Origin, target string) GetHistoryIPRequest
type GetLocationRecordRequest ¶
type GetLocationRecordRequest GetASNRecordRequest
func NewGetLocationRecord ¶
func NewGetLocationRecord(o model.Origin, ipAddr string) GetLocationRecordRequest
type GetOrCreatePersonByIDRequest ¶
type GetOrCreatePersonByIDRequest struct { BaseOrigin Target IPAddr string }
func NewGetOrCreatePersonByID ¶
func NewGetOrCreatePersonByID(o model.Origin, target string, ipAddr string) GetOrCreatePersonByIDRequest
type GetOrCreateProfileBySteamIDRequest ¶
type GetOrCreateProfileBySteamIDRequest GetOrCreatePersonByIDRequest
func NewGetOrCreateProfileBySteamID ¶
func NewGetOrCreateProfileBySteamID(o model.Origin, target string, ipAddr string) GetOrCreateProfileBySteamIDRequest
type GetPersonByIDRequest ¶
type GetPersonByIDRequest GetBanRequest
func NewGetPersonByID ¶
func NewGetPersonByID(o model.Origin, target string) GetPersonByIDRequest
type GetProxyRecordRequest ¶
type GetProxyRecordRequest GetASNRecordRequest
func NewGetProxyRecord ¶
func NewGetProxyRecord(o model.Origin, ipAddr string) GetProxyRecordRequest
type KickRequest ¶
type KickRequest struct { BaseOrigin Target Author Reason string }
type MuteRequest ¶
type MuteRequest BanRequest
type PSayRequest ¶
type PSayRequest struct { BaseOrigin Author Target Message string }
type ProfileRequest ¶
type ProfileRequest struct { BaseOrigin Target IPAddr string }
type SayRequest ¶
type SayRequest struct { BaseOrigin Author Server string Message string }
type ServerByNameRequest ¶
type ServerByNameRequest struct { BaseOrigin ServerName string }
func NewServerByName ¶
func NewServerByName(o model.Origin, serverID string) ServerByNameRequest
type SetSteamIDRequest ¶
type SetSteamIDRequest struct { BaseOrigin Target DiscordID string }
func NewSetSteamID ¶
func NewSetSteamID(o model.Origin, target string, discordID string) SetSteamIDRequest
type UnbanASNRequest ¶ added in v0.1.8
type UnbanASNRequest struct { BaseOrigin ASNum string Reason string }
type UnbanRequest ¶
type UnbanRequest KickRequest