Documentation ¶
Index ¶
- Constants
- Variables
- func AlertCmd(message *Message, p *Papi, sync bool) error
- func CustomRecoveryWithWriter() gin.HandlerFunc
- func DecisionCmd(message *Message, p *Papi, sync bool) error
- func ManagementCmd(message *Message, p *Papi, sync bool) error
- func NewAPIC(config *csconfig.OnlineApiClientCfg, dbClient *database.Client, ...) (*apic, error)
- type APIServer
- func (s *APIServer) AttachPluginBroker(broker *csplugin.PluginBroker)
- func (s *APIServer) Close()
- func (s *APIServer) GetTLSConfig() (*tls.Config, error)
- func (s *APIServer) InitController() error
- func (s *APIServer) Router() (*gin.Engine, error)
- func (s *APIServer) Run(apiReady chan bool) error
- func (s *APIServer) Shutdown() error
- type Header
- type Message
- type OperationChannels
- type Papi
- type PapiPermCheckError
- type PapiPermCheckSuccess
- type Source
Constants ¶
View Source
const (
PapiPullKey = "papi:last_pull"
)
Variables ¶
View Source
var SCOPE_CAPI_ALIAS_ALIAS string = "crowdsecurity/community-blocklist" //we don't use "CAPI" directly, to make it less confusing for the user
View Source
var (
SyncInterval = time.Second * 10
)
Functions ¶
func CustomRecoveryWithWriter ¶
func CustomRecoveryWithWriter() gin.HandlerFunc
RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
func NewAPIC ¶
func NewAPIC(config *csconfig.OnlineApiClientCfg, dbClient *database.Client, consoleConfig *csconfig.ConsoleConfig, apicWhitelist *csconfig.CapiWhitelist) (*apic, error)
Types ¶
type APIServer ¶
func (*APIServer) AttachPluginBroker ¶
func (s *APIServer) AttachPluginBroker(broker *csplugin.PluginBroker)
func (*APIServer) InitController ¶
type OperationChannels ¶
type Papi ¶
type Papi struct { URL string Client *longpollclient.LongPollClient DBClient *database.Client Channels *OperationChannels SyncInterval time.Duration Logger *log.Entry // contains filtered or unexported fields }
func (*Papi) GetPermissions ¶
func (p *Papi) GetPermissions() (PapiPermCheckSuccess, error)
func (*Papi) SendDeletedDecisions ¶
func (p *Papi) SendDeletedDecisions(cacheOrig *models.DecisionsDeleteRequest)
func (*Papi) SyncDecisions ¶
type PapiPermCheckError ¶
type PapiPermCheckError struct {
Error string `json:"error"`
}
type PapiPermCheckSuccess ¶
Click to show internal directories.
Click to hide internal directories.