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
- 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 SyncInterval = time.Second * 10
Functions ¶
func CustomRecoveryWithWriter ¶ added in v1.0.12
func CustomRecoveryWithWriter() gin.HandlerFunc
CustomRecoveryWithWriter returns a middleware for a 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 ¶
type APIServer struct { URL string UnixSocket string TLS *csconfig.TLSCfg // contains filtered or unexported fields }
func NewServer ¶
func NewServer(config *csconfig.LocalApiServerCfg) (*APIServer, error)
NewServer creates a LAPI server. It sets up a gin router, a database client, and a controller.
func (*APIServer) AttachPluginBroker ¶ added in v1.2.0
func (s *APIServer) AttachPluginBroker(broker *csplugin.PluginBroker)
func (*APIServer) InitController ¶ added in v1.2.0
type Message ¶ added in v1.5.0
type Message struct { Header *Header Data interface{} `json:"data"` }
type OperationChannels ¶ added in v1.5.0
type Papi ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (p *Papi) GetPermissions() (PapiPermCheckSuccess, error)
func (*Papi) Pull ¶ added in v1.5.0
PullPAPI is the long polling client for real-time decisions from PAPI
func (*Papi) SendDeletedDecisions ¶ added in v1.5.0
func (p *Papi) SendDeletedDecisions(cacheOrig *models.DecisionsDeleteRequest)
func (*Papi) SyncDecisions ¶ added in v1.5.0
type PapiPermCheckError ¶ added in v1.5.0
type PapiPermCheckError struct {
Error string `json:"error"`
}
type PapiPermCheckSuccess ¶ added in v1.5.0
Click to show internal directories.
Click to hide internal directories.